home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume91 / news / vnres112 / part01 next >
Internet Message Format  |  1991-03-14  |  76KB

  1. Path: news.larc.nasa.gov!amiga-request
  2. From: amiga-request@ab20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
  3. Subject: v91i047: VN res1.1-2 - vn news reader, Part01/06
  4. Reply-To: eyal@echo.canberra.edu.au (Eyal Lebedinsky)
  5. Newsgroups: comp.sources.amiga
  6. Message-ID: <comp.sources.amiga:v91i047@ab20.larc.nasa.gov>
  7. Date: 14 Mar 91 00:10:16 GMT
  8. Approved: tadguy@uunet.UU.NET (Tad Guy)
  9. X-Mail-Submissions-To: amiga@uunet.uu.net
  10. X-Post-Discussions-To: comp.sys.amiga.misc
  11.  
  12. Submitted-by: eyal@echo.canberra.edu.au (Eyal Lebedinsky)
  13. Posting-number: Volume 91, Issue 047
  14. Archive-name: news/vn-res-1.1-2/part01
  15.  
  16. [ unfortunately, Michael Taylor did not update the version number of vn 
  17.   after making his changes, so it still shows up at res1.1.  ...tad ]
  18.  
  19. I am posting this on behalf of a friend, Michael Taylor. After posting vn
  20. once before he got requests to introduce a facility for a different directory
  21. structure. He tells me it is now there.
  22.  
  23. [ this is from the last posting of vn... ]
  24.  
  25. vn is a newsreader, similar to rn, vnews or nn. It requires less memory
  26. than Arn 0.67 (Arn failed to run on my 1 meg amiga due to lack of
  27. memory) and comes with full source (executable was created with DICE
  28. V2.02). All that is required to run it is access to usenet messages (on
  29. a floppy from a friend is how I get usenet!).
  30.  
  31. vn presents you with a list of articles and allows you to select which ones 
  32. to read based on the subject and from lines. This allows you to quickly
  33. pass over news threads that are not of interest to you. Of course nn does 
  34. this and also organised the news in threads whereas vn presents the news
  35. in chronological order (this means that sometimes the original message
  36. appears after a reply - due to the order/direction the news filters through
  37. to your site). This is a vast improvement over the way rn and vnews allow you
  38. to read news. (NOTE: I do not know how Arn works as I could not run it on my
  39. 1meg A500).
  40.  
  41. updact : reads the NEWS:active file and updates it with the latest news
  42.     article number. (attempts to find the last article by continuing
  43.     from the number in the active file and scanning ahead a file at a
  44.     time for a 1000 files, if none are found then it leaves the number
  45.     alone).
  46.  
  47. gettoc: prints the subject lines to stdout. takes as input the file
  48.     names of news articles.
  49.  
  50. umbox and rnumbox: the rn and nn newsreaders will package news articles
  51.     into a mailbox format. these can then be archived. these programs
  52.     extract the articles into the correct directories.
  53.  
  54. getren: renames the article to the Vnn??? form as with comp.sources etc
  55.  
  56. Michael Taylor 
  57. Canberra
  58.  
  59. #!/bin/sh
  60. # This is a shell archive.  Remove anything before this line, then unpack
  61. # it by saving it into a file and typing "sh file".  To overwrite existing
  62. # files, type "sh file -c".  You can also feed this as standard input via
  63. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  64. # will see the following message at the end:
  65. #        "End of archive 1 (of 6)."
  66. # Contents:  .newsrc ANSI.H BRK.H Config.nested Config.notnested HEAD.H
  67. #   LIB.H MSDOS.C MSDOS.H NODE.H PAGE.H READER.H REG.C SERVER.H STD.H
  68. #   STORAGE.C STRINGS.C STRTOK.C TMPNAM.C TTY.H TUNE.H USERLIST.C VN.H
  69. #   VNGLOB.C active config.c config_std.h dfiles envx getch.c getenv.c
  70. #   getren.c gettoc.c hash.c mktemp.c newdisp.c printex.c pwd.h rand.c
  71. #   regcompat.c regexp.h stat.h stat2.c termcap termcap.h updact.c
  72. # Wrapped by tadguy@ab20 on Wed Mar 13 19:10:08 1991
  73. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  74. if test -f '.newsrc' -a "${1}" != "-c" ; then 
  75.   echo shar: Will not clobber existing file \"'.newsrc'\"
  76. else
  77. echo shar: Extracting \"'.newsrc'\" \(673 characters\)
  78. sed "s/^X//" >'.newsrc' <<'END_OF_FILE'
  79. Xaus.computers.amiga: 1-1510
  80. Xcomp.binaries.amiga: 1-454
  81. Xcomp.sources.amiga: 1-358
  82. Xalt.sources.amiga: 0
  83. Xcomp.sys.amiga: 1-36633
  84. Xcomp.sys.amiga.misc: 1-1030
  85. Xcomp.sys.amiga.announce: 1-28
  86. Xcomp.sys.amiga.tech: 1-14822
  87. Xcomp.sys.amiga.programmer: 1-991
  88. Xcomp.unix.amiga: 1-254
  89. Xcomp.sys.amiga.introduction: 1-171
  90. Xcomp.sys.amiga.marketplace: 1-244
  91. Xcomp.sys.amiga.hardware: 1-6422
  92. Xcomp.sys.amiga.applications: 1-292
  93. Xcomp.sys.amiga.audio: 1-195
  94. Xcomp.sys.amiga.multimedia: 1-91
  95. Xcomp.sys.amiga.graphics: 1-305
  96. Xcomp.sys.amiga.datacomm: 1-513
  97. Xcomp.sys.amiga.emulations: 1-229
  98. Xcomp.sys.amiga.games: 1-4271
  99. Xalt.sys.amiga.uucp: 1-1
  100. Xalt.sys.amiga.uucp.patches: 1-1
  101. Xcomp.sys.amiga.reviews: 1-1
  102. END_OF_FILE
  103. if test 673 -ne `wc -c <'.newsrc'`; then
  104.     echo shar: \"'.newsrc'\" unpacked with wrong size!
  105. fi
  106. # end of '.newsrc'
  107. fi
  108. if test -f 'ANSI.H' -a "${1}" != "-c" ; then 
  109.   echo shar: Will not clobber existing file \"'ANSI.H'\"
  110. else
  111. echo shar: Extracting \"'ANSI.H'\" \(40 characters\)
  112. sed "s/^X//" >'ANSI.H' <<'END_OF_FILE'
  113. X#define _PROTOTYPE(pgm,parms)    pgm parms
  114. END_OF_FILE
  115. if test 40 -ne `wc -c <'ANSI.H'`; then
  116.     echo shar: \"'ANSI.H'\" unpacked with wrong size!
  117. fi
  118. # end of 'ANSI.H'
  119. fi
  120. if test -f 'BRK.H' -a "${1}" != "-c" ; then 
  121.   echo shar: Will not clobber existing file \"'BRK.H'\"
  122. else
  123. echo shar: Extracting \"'BRK.H'\" \(810 characters\)
  124. sed "s/^X//" >'BRK.H' <<'END_OF_FILE'
  125. X/*
  126. X** vn news reader.
  127. X**
  128. X** brk.h - codes for sig_set routine
  129. X**
  130. X** see copyright disclaimer / history in vn.c source file
  131. X*/
  132. X
  133. X/*
  134. X    state flags for handling breaks / values for sig_set calls.
  135. X    BRK_IN, BRK_SESS, BRK_READ and BRK_OUT are the states.  All
  136. X    but BRK_INIT are used as calls to sig_set.  BRK_RFIN indicates
  137. X    a return from BRK_READ to BRK_SESS (no jump location passed),
  138. X*/
  139. X#define BRK_INIT 0        /* initial value, indicating uncaught signals */
  140. X#define BRK_IN 1        /* in NEWSRC / article scanning phase */
  141. X#define BRK_SESS 2        /* in page interactive session */
  142. X#define BRK_READ 3        /* reading articles */
  143. X#define BRK_RFIN 4        /* finished reading, return to old mode */
  144. X#define BRK_OUT 5        /* NEWSRC updating phase */
  145. X
  146. X#define BRK_PR "really quit ? "
  147. X
  148. X#ifdef amiga
  149. X#undef putchar
  150. X#define putchar ttputc
  151. X#endif
  152. X
  153. END_OF_FILE
  154. if test 810 -ne `wc -c <'BRK.H'`; then
  155.     echo shar: \"'BRK.H'\" unpacked with wrong size!
  156. fi
  157. # end of 'BRK.H'
  158. fi
  159. if test -f 'Config.nested' -a "${1}" != "-c" ; then 
  160.   echo shar: Will not clobber existing file \"'Config.nested'\"
  161. else
  162. echo shar: Extracting \"'Config.nested'\" \(548 characters\)
  163. sed "s/^X//" >'Config.nested' <<'END_OF_FILE'
  164. XNodeName      uucp
  165. XUserName      root
  166. XRealName      Foo The Bar
  167. XDebug          0
  168. XNewsFeed      newsnode
  169. XOrganization  Not an Organization
  170. XFilter          DMe
  171. XRFilter       DMe
  172. XMailEditor    DMe
  173. XDomainName    .UUCP
  174. XTimeZone      PST
  175. XDefaultNode   overload.UUCP
  176. XPALAMIGA      Y
  177. XVNUSERDIR     UULIB:
  178. XVNNEWSRC      .newsrc
  179. XVNPS1         "$ "
  180. XVNEDITOR      emacs
  181. XVNPRINTER     print
  182. XVNKEY         .vnkey
  183. XVNCCFILE      author_copy
  184. XVNSAVE        NEWS:
  185. XVNMORE
  186. XVNMAILER
  187. XVNPOSTER
  188. XVNTERM        amiga-p
  189. XVNACTFILE     news:active
  190. XVNNEWSDIR     news:
  191. XVNNESTED      Y
  192. END_OF_FILE
  193. if test 548 -ne `wc -c <'Config.nested'`; then
  194.     echo shar: \"'Config.nested'\" unpacked with wrong size!
  195. fi
  196. # end of 'Config.nested'
  197. fi
  198. if test -f 'Config.notnested' -a "${1}" != "-c" ; then 
  199.   echo shar: Will not clobber existing file \"'Config.notnested'\"
  200. else
  201. echo shar: Extracting \"'Config.notnested'\" \(552 characters\)
  202. sed "s/^X//" >'Config.notnested' <<'END_OF_FILE'
  203. XNodeName      uucp
  204. XUserName      root
  205. XRealName      Foo The Bar
  206. XDebug          0
  207. XNewsFeed      newsnode
  208. XOrganization  Not an Organization
  209. XFilter          DMe
  210. XRFilter       DMe
  211. XMailEditor    DMe
  212. XDomainName    .UUCP
  213. XTimeZone      PST
  214. XDefaultNode   overload.UUCP
  215. XPALAMIGA      Y
  216. XVNUSERDIR     UULIB:
  217. XVNNEWSRC      .newsrc
  218. XVNPS1         "$ "
  219. XVNEDITOR      emacs
  220. XVNPRINTER     print
  221. XVNKEY         .vnkey
  222. XVNCCFILE      author_copy
  223. XVNSAVE        NEWS:
  224. XVNMORE
  225. XVNMAILER
  226. XVNPOSTER
  227. XVNTERM        amiga-n
  228. XVNACTFILE     UUNEWS:active
  229. XVNNEWSDIR     UUNEWS:
  230. XVNNESTED      N
  231. END_OF_FILE
  232. if test 552 -ne `wc -c <'Config.notnested'`; then
  233.     echo shar: \"'Config.notnested'\" unpacked with wrong size!
  234. fi
  235. # end of 'Config.notnested'
  236. fi
  237. if test -f 'HEAD.H' -a "${1}" != "-c" ; then 
  238.   echo shar: Will not clobber existing file \"'HEAD.H'\"
  239. else
  240. echo shar: Extracting \"'HEAD.H'\" \(2590 characters\)
  241. sed "s/^X//" >'HEAD.H' <<'END_OF_FILE'
  242. X/*
  243. X** vn news reader.
  244. X**
  245. X** head.h - header line structure
  246. X**
  247. X** see copyright disclaimer / history in vn.c source file
  248. X*/
  249. X
  250. X/*
  251. X** How this thing works:
  252. X**
  253. X** this structure is filled in by vns_aopen when opening an article.
  254. X** lines & hlines items will be used in providing percentage read prompts
  255. X**
  256. X** show_num & show are the article information lines presented for the user
  257. X** when the "show headers" flag is turned off.
  258. X**
  259. X** from and artid are used for mail salutations, etc.
  260. X**
  261. X** The items used for mail replies, FOLLOWING the call to the mail massager
  262. X** if there is one, are mailcmd, mail_num, and mail.  These are the items
  263. X** the massager should fill in.  If no massager exists, vns_aopen will
  264. X** fill these in directly.  If mail_err is non-null, the user won't be
  265. X** able to mail a reply to the article, and the item should be an error
  266. X** message explaining why.  If there is a mailer function, the mailcmd
  267. X** item is not used.
  268. X**
  269. X** The priv and priv_num items are for sole use of the server layer in
  270. X** the mail massager, mailer and poster functions.
  271. X**
  272. X** The postcmd, post_num, and post arguments are used in treatment of
  273. X** followups.  If post_err is non-null, followup won't be allowed, for
  274. X** the reason described therein.  If there is a poster function, the
  275. X** postcmd item isn't used.
  276. X**
  277. X** The header lines for inclusion in mail / followup files will open
  278. X** the file, and will be followed by one blank line.  The lines are literal -
  279. X** all appropriate headers should be prepended, etc.
  280. X**
  281. X** postcmd / mailcmd are used as format strings which are assumed to have a
  282. X** single %s in them some place for the placement of the users editted file.
  283. X** The result will be spawned as a command.
  284. X*/
  285. X
  286. Xtypedef struct
  287. X{
  288. X    int lines;        /* number of lines in article */
  289. X    int hlines;        /* number of header lines in article */
  290. X    char *from;        /* authors name */
  291. X    char *artid;        /* article id */
  292. X    int show_num;        /* number of extra lines for reader display */
  293. X    char **show;        /* extra header lines */
  294. X    int priv_num;        /* number of private arguments */
  295. X    char **priv;        /* private server arguments */
  296. X    char *mail_err;        /* mail reply error message */
  297. X    char *mailcmd;        /* command line for mailer */
  298. X    int mail_num;        /* number of header lines in mail reply file */
  299. X    char **mail;        /* mail reply header lines */
  300. X    char *post_err;        /* follow-up posting error message */
  301. X    char *postcmd;        /* command line for followup poster */
  302. X    int post_num;        /* number of header lines for followup file */
  303. X    char **post;        /* followup header lines */
  304. X} ARTHEADER;
  305. X
  306. X#ifdef amiga
  307. X#undef putchar
  308. X#define putchar ttputc
  309. X#endif
  310. X
  311. END_OF_FILE
  312. if test 2590 -ne `wc -c <'HEAD.H'`; then
  313.     echo shar: \"'HEAD.H'\" unpacked with wrong size!
  314. fi
  315. # end of 'HEAD.H'
  316. fi
  317. if test -f 'LIB.H' -a "${1}" != "-c" ; then 
  318.   echo shar: Will not clobber existing file \"'LIB.H'\"
  319. else
  320. echo shar: Extracting \"'LIB.H'\" \(23 characters\)
  321. sed "s/^X//" >'LIB.H' <<'END_OF_FILE'
  322. X#define    PRIVATE    static
  323. END_OF_FILE
  324. if test 23 -ne `wc -c <'LIB.H'`; then
  325.     echo shar: \"'LIB.H'\" unpacked with wrong size!
  326. fi
  327. # end of 'LIB.H'
  328. fi
  329. if test -f 'MSDOS.C' -a "${1}" != "-c" ; then 
  330.   echo shar: Will not clobber existing file \"'MSDOS.C'\"
  331. else
  332. echo shar: Extracting \"'MSDOS.C'\" \(2463 characters\)
  333. sed "s/^X//" >'MSDOS.C' <<'END_OF_FILE'
  334. X#include <stdio.h>
  335. X#include <string.h>
  336. X#include <pwd.h>
  337. X
  338. X#ifdef    MSDOS
  339. X
  340. X#include <dos.h>
  341. X#include "vn.h"
  342. X
  343. X#define K_F1    +59
  344. X#define K_F2    +60
  345. X#define K_F3    +61
  346. X#define K_F4    +62
  347. X#define K_F5    +63
  348. X#define K_F6    +64
  349. X#define K_F7    +65
  350. X#define K_F8    +66
  351. X#define K_F9    +67
  352. X#define K_F10    +68
  353. X#define K_SF1    +84
  354. X#define K_SF2    +85
  355. X#define K_SF3    +86
  356. X#define K_SF4    +87
  357. X#define K_SF5    +88
  358. X#define K_SF6    +89
  359. X#define K_SF7    +90
  360. X#define K_SF8    +91
  361. X#define K_SF9    +92
  362. X#define K_SF10    +93
  363. X#define K_CF1    +94
  364. X#define K_CF2    +95
  365. X#define K_CF3    +96
  366. X#define K_CF4    +97
  367. X#define K_CF5    +98
  368. X#define K_CF6    +99
  369. X#define K_CF7    +100
  370. X#define K_CF8    +101
  371. X#define K_CF9    +102
  372. X#define K_CF10    +103
  373. X#define K_AF1    +104
  374. X#define K_AF2    +105
  375. X#define K_AF3    +106
  376. X#define K_AF4    +107
  377. X#define K_AF5    +108
  378. X#define K_AF6    +109
  379. X#define K_AF7    +110
  380. X#define K_AF8    +111
  381. X#define K_AF9    +112
  382. X#define K_AF10    +113
  383. X#define K_LEFT    +75
  384. X#define K_RIGHT    +77
  385. X#define K_UP    +72
  386. X#define K_DOWN    +80
  387. X#define K_PGUP    +73
  388. X#define K_PGDN    +81
  389. X#define K_HOME    +71
  390. X#define K_END    +79
  391. X#define K_CPGUP    +132
  392. X#define K_CPGDN    +118
  393. X#define K_CHOME    +119
  394. X#define K_CEND    +117
  395. X#define K_CLEFT    +115
  396. X#define K_CRIGHT +116
  397. X#define K_INS    +82
  398. X#define K_DEL    +83
  399. X
  400. Xstruct passwd *
  401. Xgetpwuid (uid)
  402. Xint    uid;
  403. X{
  404. X    static struct passwd passwd;
  405. X
  406. X    passwd.pw_dir = "f:\\home";
  407. X    passwd.pw_name = "User";
  408. X
  409. X    return (&passwd);
  410. X}
  411. X
  412. Xstruct passwd *
  413. Xgetpwnam (name)
  414. Xchar    *name;
  415. X{
  416. X    static struct passwd passwd;
  417. X    static char    pw_name[20];
  418. X
  419. X    passwd.pw_dir = "f:\\home";
  420. X    passwd.pw_name = pw_name;
  421. X    strncpy (pw_name, name, sizeof (pw_name));
  422. X
  423. X    return (&passwd);
  424. X}
  425. X
  426. Xint
  427. Xgetuid ()
  428. X{
  429. X    return (0);
  430. X}
  431. X
  432. Xint
  433. Xlink (from, to)
  434. Xchar    *from, *to;
  435. X{
  436. X    char    command[128];
  437. X
  438. X    strcpy (command, "copy ");
  439. X    strcat (command, from);
  440. X    strcat (command, " ");
  441. X    strcat (command, to);
  442. X    strcat (command, " >nul \n");
  443. X
  444. X    return (system (command));
  445. X}
  446. X
  447. Xint
  448. Xgetraw ()
  449. X{
  450. X    int    c;
  451. X
  452. X    while (!(c = getch ()))    {    /* no funnies... */
  453. X        switch (c = getch ()) {
  454. X        case K_UP:
  455. X            c = UP;
  456. X            break;
  457. X        case K_DOWN:
  458. X            c = DOWN;
  459. X            break;
  460. X        case K_PGDN:
  461. X            c = FORWARD;
  462. X            break;
  463. X        case K_PGUP:
  464. X            c = BACK;
  465. X            break;
  466. X        default:
  467. X            continue;    /* ignore */
  468. X        }
  469. X        break;
  470. X    }
  471. X    return (c);
  472. X}
  473. X
  474. X#undef    chdir
  475. X
  476. Xstatic char abc[] = " ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  477. X
  478. Xint
  479. Xdoschdir (dir)
  480. Xchar    *dir;
  481. X{
  482. X    int    a, b;
  483. X    char    *p;
  484. X
  485. X    if (dir[1] == ':') {
  486. X        if ((p = index (abc, toupper (dir[0]))) == NULL ||
  487. X            *p == '\0')
  488. X            return (1);
  489. X        a = p - abc;
  490. X        _dos_setdrive (a, &b);
  491. X        _dos_getdrive (&b);
  492. X        if (a != b)
  493. X            return (1);
  494. X        dir += 2;
  495. X    }
  496. X    return (chdir (dir));
  497. X}
  498. X
  499. X#endif
  500. END_OF_FILE
  501. if test 2463 -ne `wc -c <'MSDOS.C'`; then
  502.     echo shar: \"'MSDOS.C'\" unpacked with wrong size!
  503. fi
  504. # end of 'MSDOS.C'
  505. fi
  506. if test -f 'MSDOS.H' -a "${1}" != "-c" ; then 
  507.   echo shar: Will not clobber existing file \"'MSDOS.H'\"
  508. else
  509. echo shar: Extracting \"'MSDOS.H'\" \(51 characters\)
  510. sed "s/^X//" >'MSDOS.H' <<'END_OF_FILE'
  511. Xstruct passwd {
  512. X    char    *pw_dir;
  513. X    char    *pw_name;
  514. X};
  515. X
  516. END_OF_FILE
  517. if test 51 -ne `wc -c <'MSDOS.H'`; then
  518.     echo shar: \"'MSDOS.H'\" unpacked with wrong size!
  519. fi
  520. # end of 'MSDOS.H'
  521. fi
  522. if test -f 'NODE.H' -a "${1}" != "-c" ; then 
  523.   echo shar: Will not clobber existing file \"'NODE.H'\"
  524. else
  525. echo shar: Extracting \"'NODE.H'\" \(1640 characters\)
  526. sed "s/^X//" >'NODE.H' <<'END_OF_FILE'
  527. X/*
  528. X** vn news reader.
  529. X**
  530. X** node.h - NODE structure
  531. X**
  532. X** see copyright disclaimer / history in vn.c source file
  533. X*/
  534. X
  535. X/* newsgroup status flags */
  536. X#define FLG_SUB 1    /* user subscribed to newsgroup */
  537. X#define FLG_PAGE 2    /* a page exists to display */
  538. X#define FLG_NEW 4    /* new newsgroup */
  539. X#define FLG_ECHG 8    /* edit change by user */
  540. X#define FLG_SEARCH 16    /* newsgroup was searched */
  541. X#define FLG_ACC 32    /* newsgroup had articles accessed */
  542. X#define FLG_STAT 64    /* stat's written */
  543. X
  544. X/*
  545. X    newsgroup information (hash table node)
  546. X
  547. X    items unaccessed by server interface:
  548. X        next - hashtable link
  549. X        pnum - page number
  550. X        pages - number of pages for news display
  551. X        pgshwn - pages shown mask
  552. X        pgrd - article number on highest conecutively shown page
  553. X        order - order of appearance in Newsorder array.
  554. X        orgrd - original articles read number
  555. X
  556. X    may be read following hashfind by server interface, but not written:
  557. X        nd_name - name of newsgroup (key to reach node by)
  558. X            this will be a permanent copy of the name.
  559. X        highnum - high article number in group
  560. X        lownum - low article number in group
  561. X
  562. X    legal for vns_write to read, but not written by server interface:
  563. X        flags - bit mask of FLG_xxxx flags.
  564. X        rdnum - articles read.
  565. X
  566. X    unused by vn user interface, intended for use by server interface:
  567. X        state - state variable.  initted 0.
  568. X        data - arbitrary data pointer.  initted NULL.
  569. X*/
  570. Xtypedef struct _node
  571. X{
  572. X    struct _node *next;
  573. X    char *nd_name;
  574. X    int highnum, lownum;
  575. X    int pnum, pages, rdnum, orgrd, pgrd;
  576. X    unsigned long pgshwn;
  577. X    unsigned flags;
  578. X    int order;
  579. X    unsigned state;
  580. X    char *data;
  581. X} NODE;
  582. X
  583. X#ifdef amiga
  584. X#undef putchar
  585. X#define putchar ttputc
  586. X#endif
  587. X
  588. END_OF_FILE
  589. if test 1640 -ne `wc -c <'NODE.H'`; then
  590.     echo shar: \"'NODE.H'\" unpacked with wrong size!
  591. fi
  592. # end of 'NODE.H'
  593. fi
  594. if test -f 'PAGE.H' -a "${1}" != "-c" ; then 
  595.   echo shar: Will not clobber existing file \"'PAGE.H'\"
  596. else
  597. echo shar: Extracting \"'PAGE.H'\" \(1212 characters\)
  598. sed "s/^X//" >'PAGE.H' <<'END_OF_FILE'
  599. X/*
  600. X** vn news reader.
  601. X**
  602. X** page.h - display page structure
  603. X**
  604. X** see copyright disclaimer / history in vn.c source file
  605. X*/
  606. X
  607. X/*
  608. X    page display format and dependent parameters
  609. X*/
  610. X#define HFORMAT "\n%s (page %d of %d):"
  611. X#define DHFORMAT "\n%s (DIGEST EXTRACTION):"
  612. X#define TFORMAT "%s ~ %s %s"
  613. X#define AFORMAT "\n%c%c%d) "    /* begin with newline - see show routine */
  614. X#define AFLEN 5        /* min. char. in article id - depends on AFORMAT */
  615. X#define CFORMAT "page %d of %d (%d shown), newsgroup %d of %d"
  616. X#define RECBIAS 2    /* lines before articles - depends on HFORMAT */
  617. X#define WRCOL 1        /* column of written mark.  depends on AFORMAT */
  618. X#define INFOLINE 0    /* HFORMAT TFORMAT leaves for use */
  619. X#define REQLINES 7    /* required terminal lines for display, incl. help */
  620. X
  621. X/*
  622. X    newsgroup information for page display
  623. X    name - of group
  624. X    group - pointer to table entry
  625. X    artnum - number of articles
  626. X*/
  627. Xtypedef struct
  628. X{
  629. X    char *name;
  630. X    NODE *group;
  631. X    int artnum;
  632. X} HEAD;
  633. X
  634. X/*
  635. X    article information - id (spool) number, title string, mark, written.
  636. X*/
  637. Xtypedef struct
  638. X{
  639. X    int art_id;
  640. X    char art_mark;
  641. X    char art_t[MAX_C-AFLEN];
  642. X} BODY;
  643. X
  644. Xtypedef struct
  645. X{
  646. X    HEAD h;
  647. X    BODY *b;
  648. X} PAGE;
  649. X
  650. X#ifdef amiga
  651. X#undef putchar
  652. X#define putchar ttputc
  653. X#endif
  654. X
  655. END_OF_FILE
  656. if test 1212 -ne `wc -c <'PAGE.H'`; then
  657.     echo shar: \"'PAGE.H'\" unpacked with wrong size!
  658. fi
  659. # end of 'PAGE.H'
  660. fi
  661. if test -f 'READER.H' -a "${1}" != "-c" ; then 
  662.   echo shar: Will not clobber existing file \"'READER.H'\"
  663. else
  664. echo shar: Extracting \"'READER.H'\" \(1597 characters\)
  665. sed "s/^X//" >'READER.H' <<'END_OF_FILE'
  666. X/*
  667. X** vn news reader.
  668. X**
  669. X** reader.h - article reading interface definitions
  670. X**
  671. X** see copyright disclaimer / history in vn.c source file
  672. X*/
  673. X
  674. X#define PAGE_MID ":more (%2d%%):"
  675. X#define PAGE_NEXT ":next article:"
  676. X#define PAGE_END ":end:"
  677. X#define PAGE_NO ":?:"
  678. X#define PPR_MAX 18    /* maximum length of PAGE prompts */
  679. X
  680. X/*
  681. X    reading commands: no control chars, add help message to helppg
  682. X    SAVE, PRINT, HEADTOG and SETROT are also recognized
  683. X*/
  684. X#define HPG_HEAD "toggle header print flag"
  685. X#define HPG_ROT "toggle rotation"
  686. X#define HPG_SAVE "save article in a file"
  687. X#define HPG_PRINT "print article"
  688. X#define PG_NEXT 'n'
  689. X#define HPG_NEXT "next article, if any"
  690. X#define PG_QUIT 'q'
  691. X#define HPG_QUIT "quit reading articles, if any more to read"
  692. X#define PG_FLIP 'Q'
  693. X#define HPG_FLIP "quit reading, and turn to next page of articles"
  694. X#define PG_FOLLOW 'f'
  695. X#define HPG_FOLLOW "post followup to article"
  696. X#define PG_REPLY 'm'
  697. X#define HPG_REPLY "send mail to author of article"
  698. X#define PG_HELP '?'
  699. X#define HPG_HELP "see this help menu"
  700. X#define PG_REWIND 'r'
  701. X#define HPG_REWIND "rewind article to beginning"
  702. X#define PG_WIND 'e'
  703. X#define HPG_WIND "seek to end of article (to next/end prompt)"
  704. X#define PG_STEP '\n'
  705. X#define HPG_STEP "next line"
  706. X#define PG_SEARCH '/'
  707. X#define HPG_SEARCH "search for regular expression in remainder of article"
  708. X#define SEARCHFORM "search pattern (%s) ? "
  709. X#define HPG_DEF "\n anything else to continue normal reading"
  710. X#define HPG_EDEF "\n anything else to try reading next article, if any"
  711. X
  712. X#define ANFORM ":%s - %c for help:\n"
  713. X
  714. X#ifdef amiga
  715. X#undef putchar
  716. X#define putchar ttputc
  717. X#endif
  718. X
  719. END_OF_FILE
  720. if test 1597 -ne `wc -c <'READER.H'`; then
  721.     echo shar: \"'READER.H'\" unpacked with wrong size!
  722. fi
  723. # end of 'READER.H'
  724. fi
  725. if test -f 'REG.C' -a "${1}" != "-c" ; then 
  726.   echo shar: Will not clobber existing file \"'REG.C'\"
  727. else
  728. echo shar: Extracting \"'REG.C'\" \(1681 characters\)
  729. sed "s/^X//" >'REG.C' <<'END_OF_FILE'
  730. X/*
  731. X** vn news reader.
  732. X**
  733. X** reg.c - implementation of regex / regcmp on top of UCB library
  734. X**
  735. X** see copyright disclaimer / history in vn.c source file
  736. X*/
  737. X
  738. X#include <stdio.h>
  739. X
  740. X#define RGBLKSIZE 20
  741. X
  742. Xstruct _regtab
  743. X{
  744. X    struct _regtab *link;
  745. X    char *regstr;
  746. X};
  747. X
  748. Xtypedef struct _regtab REGTAB;
  749. X
  750. Xstatic REGTAB *Chain = NULL;
  751. Xstatic REGTAB *Free = NULL;
  752. Xstatic REGTAB *Compiled = NULL;
  753. X
  754. Xextern char *malloc ();
  755. X
  756. Xregfree(s)
  757. Xchar *s;
  758. X{
  759. X    REGTAB *ptr,*cmp,*old;
  760. X
  761. X    cmp = (REGTAB *) s;
  762. X    old = NULL;
  763. X
  764. X    for (ptr = Chain; ptr != NULL; ptr = (old = ptr)->link)
  765. X    {
  766. X        if (ptr == cmp)
  767. X        {
  768. X            if (old == NULL)
  769. X                Chain = Chain->link;
  770. X            else
  771. X                old->link = ptr->link;
  772. X            ptr->link = Free;
  773. X            Free = ptr;
  774. X            break;
  775. X        }
  776. X    }
  777. X}
  778. X
  779. Xchar *regcmp(str)
  780. Xchar *str;
  781. X{
  782. X    int i;
  783. X    char *str_store();
  784. X    char *re_comp();
  785. X
  786. X    if (re_comp(str) != NULL)
  787. X    {
  788. X        Compiled = NULL;    /* make sure we're OK */
  789. X        return(NULL);
  790. X    }
  791. X
  792. X    if (Free == NULL)
  793. X    {
  794. X        Free = (REGTAB *) malloc(RGBLKSIZE * sizeof(REGTAB));
  795. X        if (Free == NULL)
  796. X            printex ("regcmp: memory allocation failure");
  797. X        for (i = 0; i < RGBLKSIZE - 1; ++i)
  798. X            Free[i].link = Free + i + 1;
  799. X        Free[i].link = NULL;
  800. X    }
  801. X
  802. X    Compiled = Free;
  803. X    Free = Free->link;
  804. X
  805. X    Compiled->link = Chain;
  806. X    Chain = Compiled;
  807. X    Compiled->regstr = str_store(str);
  808. X
  809. X    return ((char *) Compiled);
  810. X}
  811. X
  812. Xchar *regex(reg,str)
  813. Xchar *reg,*str;
  814. X{
  815. X    REGTAB *cmp;
  816. X
  817. X    cmp = (REGTAB *) reg;
  818. X
  819. X    if (cmp == Compiled)
  820. X    {
  821. X        if (re_exec(str))
  822. X            return(str);
  823. X        return (NULL);
  824. X    }
  825. X
  826. X    for (Compiled = Chain; Compiled != NULL; Compiled = Compiled->link)
  827. X    {
  828. X        if (Compiled == cmp)
  829. X            break;
  830. X    }
  831. X
  832. X    if (Compiled == NULL)
  833. X        printex ("regex: bad pointer");
  834. X
  835. X    re_comp(Compiled->regstr);
  836. X
  837. X    if (re_exec(str))
  838. X        return(str);
  839. X
  840. X    return(NULL);
  841. X}
  842. END_OF_FILE
  843. if test 1681 -ne `wc -c <'REG.C'`; then
  844.     echo shar: \"'REG.C'\" unpacked with wrong size!
  845. fi
  846. # end of 'REG.C'
  847. fi
  848. if test -f 'SERVER.H' -a "${1}" != "-c" ; then 
  849.   echo shar: Will not clobber existing file \"'SERVER.H'\"
  850. else
  851. echo shar: Extracting \"'SERVER.H'\" \(151 characters\)
  852. sed "s/^X//" >'SERVER.H' <<'END_OF_FILE'
  853. X
  854. X/*
  855. X**    header files shared between vn and vns_xxxx server interface routines
  856. X*/
  857. X#include "tune.h"
  858. X#include "tty.h"
  859. X#include "node.h"
  860. X#include "head.h"
  861. END_OF_FILE
  862. if test 151 -ne `wc -c <'SERVER.H'`; then
  863.     echo shar: \"'SERVER.H'\" unpacked with wrong size!
  864. fi
  865. # end of 'SERVER.H'
  866. fi
  867. if test -f 'STD.H' -a "${1}" != "-c" ; then 
  868.   echo shar: Will not clobber existing file \"'STD.H'\"
  869. else
  870. echo shar: Extracting \"'STD.H'\" \(946 characters\)
  871. sed "s/^X//" >'STD.H' <<'END_OF_FILE'
  872. X/*
  873. X    newsrc states
  874. X*/
  875. X#define NEWS_ON ':'
  876. X#define NEWS_OFF '!'
  877. X
  878. X#define SFLG_SCAN 1
  879. X#define SFLG_SPEC 2
  880. X
  881. X#define FPFIX "Re: "
  882. X#define FPFLEN 4
  883. X
  884. X#define FIL_AUTHOR 'w'
  885. X#define FIL_TITLE 't'
  886. X
  887. X/*
  888. X    header lines and associated lengths.  Strings should
  889. X    actually be used only once.
  890. X*/ 
  891. X#define RHEAD "References: "
  892. X#define RHDLEN 12
  893. X#define MHEAD "Message-ID: "
  894. X#define MHDLEN 12
  895. X#define PHEAD "Path: "
  896. X#define PHDLEN 6
  897. X#define DHEAD "Date: "
  898. X#define DHDLEN 6
  899. X#define RTHEAD "Reply-To: "
  900. X#define RTHDLEN 10
  901. X#define TOHEAD "To: "
  902. X#define TOHDLEN 4
  903. X#define FHEAD "From: "
  904. X#define FHDLEN 6
  905. X#define FTHEAD "Followup-To: "
  906. X#define FTHDLEN 13
  907. X#define DISHEAD "Distribution: "
  908. X#define DISHDLEN 14
  909. X#define THEAD "Subject: "
  910. X#define THDLEN 9
  911. X#define LHEAD "Lines: "
  912. X#define LHDLEN 7
  913. X#define NHEAD "Newsgroups: "
  914. X#define NHDLEN 12
  915. X
  916. X#define CHFIRST "FSL"    /* first char's of those used in page display */
  917. X
  918. X#ifdef amiga
  919. X#undef putchar
  920. X#define putchar ttputc
  921. X#endif
  922. X
  923. END_OF_FILE
  924. if test 946 -ne `wc -c <'STD.H'`; then
  925.     echo shar: \"'STD.H'\" unpacked with wrong size!
  926. fi
  927. # end of 'STD.H'
  928. fi
  929. if test -f 'STORAGE.C' -a "${1}" != "-c" ; then 
  930.   echo shar: Will not clobber existing file \"'STORAGE.C'\"
  931. else
  932. echo shar: Extracting \"'STORAGE.C'\" \(2261 characters\)
  933. sed "s/^X//" >'STORAGE.C' <<'END_OF_FILE'
  934. X/*
  935. X** vn news reader.
  936. X**
  937. X** storage.c - storage allocation routines
  938. X**
  939. X** see copyright disclaimer / history in vn.c source file
  940. X*/
  941. X
  942. X#include <stdio.h>
  943. X#include "tune.h"
  944. X#include "node.h"
  945. X#include "page.h"
  946. X
  947. Xextern char *malloc();
  948. X
  949. Xextern int L_allow;
  950. X
  951. Xextern PAGE Page;
  952. X/*
  953. X    Storage allocaters.
  954. X*/
  955. X
  956. Xchar *str_store (s)
  957. Xchar *s;
  958. X{
  959. X    static unsigned av_len = 0;    /* current storage available */
  960. X    static char *avail;
  961. X    int len;
  962. X
  963. X    if (s == NULL)
  964. X        s = "";
  965. X
  966. X    if ((len = strlen(s)+1) > av_len)
  967. X    {
  968. X        if (len > STRBLKSIZE)
  969. X            av_len = len;
  970. X        else
  971. X            av_len = STRBLKSIZE;
  972. X        if ((avail = malloc(av_len)) == NULL)
  973. X            printex ("can't allocate memory for string storage");
  974. X    }
  975. X    strcpy (avail,s);
  976. X    s = avail;
  977. X    avail += len;
  978. X    av_len -= len;
  979. X    return (s);
  980. X}
  981. X
  982. X/*
  983. X** called after number of terminal lines (L_allow) is known, to set
  984. X** up storage for Page.
  985. X*/
  986. Xpage_alloc ()
  987. X{
  988. X    char *body;
  989. X
  990. X    if ((body = malloc(L_allow*sizeof(BODY))) == NULL)
  991. X        printex ("can't allocate memory for display storage");
  992. X
  993. X    Page.b = (BODY *) body;
  994. X}
  995. X
  996. XNODE
  997. X*node_store()
  998. X{
  999. X    static int nd_avail = 0;
  1000. X    static NODE *nd;
  1001. X    NODE *ret;
  1002. X
  1003. X    if (nd_avail <= 0)
  1004. X    {
  1005. X        if ((nd = (NODE *) malloc(sizeof(NODE)*NDBLKSIZE)) == NULL)
  1006. X            printex ("can't allocate memory for newsgroup table");
  1007. X        nd_avail = NDBLKSIZE;
  1008. X    }
  1009. X    --nd_avail;
  1010. X    ret = nd;
  1011. X    ++nd;
  1012. X    return(ret);
  1013. X}
  1014. X
  1015. X/*
  1016. X** temp string storage
  1017. X*/
  1018. X
  1019. Xtypedef struct
  1020. X{
  1021. X    int len;
  1022. X    int idx;
  1023. X    char **ptr;
  1024. X} STRINGPOOL;
  1025. X
  1026. Xchar *
  1027. Xstr_tpool(n)
  1028. Xint n;
  1029. X{
  1030. X    int size;
  1031. X    STRINGPOOL *p;
  1032. X
  1033. X    size = sizeof(STRINGPOOL) + n * sizeof(char **);
  1034. X
  1035. X    if ((p = (STRINGPOOL *) malloc(size)) == NULL)
  1036. X        printex("Cannot allocate temporary string storage");
  1037. X
  1038. X    p->ptr = (char **)(p+1);
  1039. X    p->len = n;
  1040. X    p->idx = 0;
  1041. X
  1042. X    return((char *) p);
  1043. X}
  1044. X
  1045. Xchar *
  1046. Xstr_tstore(cp,s)
  1047. Xchar *cp;
  1048. Xchar *s;
  1049. X{
  1050. X    STRINGPOOL *p;
  1051. X    int len;
  1052. X
  1053. X    p = (STRINGPOOL *) cp;
  1054. X    if (p->idx >= p->len)
  1055. X        printex("Temporary string storage overflow");
  1056. X    len = strlen(s)+1;
  1057. X    if ((cp = malloc(len)) == NULL)
  1058. X        printex("Cannot allocate copy of string");
  1059. X    strcpy(cp,s);
  1060. X    (p->ptr)[p->idx] = cp;
  1061. X    ++(p->idx);
  1062. X
  1063. X    return(cp);
  1064. X}
  1065. X
  1066. Xchar **
  1067. Xstr_taptr(cp)
  1068. Xchar *cp;
  1069. X{
  1070. X    STRINGPOOL *p;
  1071. X
  1072. X    p = (STRINGPOOL *) cp;
  1073. X
  1074. X    return (p->ptr + p->idx);
  1075. X}
  1076. X
  1077. Xstr_tfree(cp)
  1078. Xchar *cp;
  1079. X{
  1080. X    STRINGPOOL *p;
  1081. X    int i;
  1082. X
  1083. X    p = (STRINGPOOL *) cp;
  1084. X    for (i=0; i < p->idx; ++i)
  1085. X        free((p->ptr)[i]);
  1086. X    free (cp);
  1087. X}
  1088. END_OF_FILE
  1089. if test 2261 -ne `wc -c <'STORAGE.C'`; then
  1090.     echo shar: \"'STORAGE.C'\" unpacked with wrong size!
  1091. fi
  1092. # end of 'STORAGE.C'
  1093. fi
  1094. if test -f 'STRINGS.C' -a "${1}" != "-c" ; then 
  1095.   echo shar: Will not clobber existing file \"'STRINGS.C'\"
  1096. else
  1097. echo shar: Extracting \"'STRINGS.C'\" \(537 characters\)
  1098. sed "s/^X//" >'STRINGS.C' <<'END_OF_FILE'
  1099. X/*
  1100. X** vn news reader.
  1101. X**
  1102. X** strings.c - read only character strings
  1103. X**
  1104. X** see copyright disclaimer / history in vn.c source file
  1105. X*/
  1106. X
  1107. X#include "tune.h"
  1108. X#include "node.h"
  1109. X#include "page.h"
  1110. X
  1111. Xchar *Version = "4/88";
  1112. X
  1113. Xchar *No_msg = "No articles";
  1114. Xchar *Hdon_msg = "Headers being printed";
  1115. Xchar *Hdoff_msg = "Headers being suppressed";
  1116. Xchar *Roton_msg = "ROT 13";
  1117. Xchar *Rotoff_msg = "NO ROT";
  1118. X
  1119. Xchar *Aformat = AFORMAT;
  1120. X
  1121. Xchar *Contstr = "  ******** any key to continue ********";
  1122. X
  1123. Xchar *Brk_fmt = "QUIT (signal %d)";
  1124. X
  1125. Xchar *List_sep = " \t,";
  1126. END_OF_FILE
  1127. if test 537 -ne `wc -c <'STRINGS.C'`; then
  1128.     echo shar: \"'STRINGS.C'\" unpacked with wrong size!
  1129. fi
  1130. # end of 'STRINGS.C'
  1131. fi
  1132. if test -f 'STRTOK.C' -a "${1}" != "-c" ; then 
  1133.   echo shar: Will not clobber existing file \"'STRTOK.C'\"
  1134. else
  1135. echo shar: Extracting \"'STRTOK.C'\" \(1082 characters\)
  1136. sed "s/^X//" >'STRTOK.C' <<'END_OF_FILE'
  1137. X/*
  1138. X** vn news reader.
  1139. X**
  1140. X** strtok.c - strtok() and strpbrk() string routines using UCB index().
  1141. X**
  1142. X** see copyright disclaimer / history in vn.c source file
  1143. X*/
  1144. X
  1145. X#include <stdio.h>
  1146. X
  1147. Xchar *strpbrk (s,del)
  1148. Xchar *s, *del;
  1149. X{
  1150. X    char *ptr,*index();
  1151. X    if (s == NULL)
  1152. X        return (NULL);
  1153. X    for (; *del != '\0'; ++del)
  1154. X        if ((ptr = index(s,*del)) != NULL)
  1155. X            return (ptr);
  1156. X    return (NULL);
  1157. X}
  1158. X
  1159. Xchar *strtok(str,delim)
  1160. Xchar *str, *delim;
  1161. X{
  1162. X    char *tokstart, *tokend, *first_ch (), *last_ch();
  1163. X    static char *save=NULL;
  1164. X
  1165. X    if (str != NULL)
  1166. X        save = str;
  1167. X
  1168. X    if (save == NULL)
  1169. X        return (NULL);
  1170. X
  1171. X    tokstart = first_ch (save, delim);
  1172. X    tokend = last_ch (tokstart, delim);
  1173. X    save = first_ch (tokend, delim);
  1174. X    *tokend = '\0';
  1175. X
  1176. X    if (*tokstart == '\0')
  1177. X        return (NULL);
  1178. X
  1179. X    return (tokstart);
  1180. X}
  1181. X
  1182. Xstatic char *first_ch (str,delim)
  1183. Xchar *str,*delim;
  1184. X{
  1185. X    char *index ();
  1186. X    char *f;
  1187. X
  1188. X    for (f = str; *f != '\0' && index(delim,*f) != NULL; ++f)
  1189. X        ;
  1190. X
  1191. X    return (f);
  1192. X}
  1193. X
  1194. Xstatic char *last_ch (str,delim)
  1195. Xchar *str,*delim;
  1196. X{
  1197. X    char *index ();
  1198. X    char *f;
  1199. X
  1200. X    for (f = str; *f != '\0' && index(delim,*f) == NULL; ++f)
  1201. X        ;
  1202. X
  1203. X    return (f);
  1204. X}
  1205. END_OF_FILE
  1206. if test 1082 -ne `wc -c <'STRTOK.C'`; then
  1207.     echo shar: \"'STRTOK.C'\" unpacked with wrong size!
  1208. fi
  1209. # end of 'STRTOK.C'
  1210. fi
  1211. if test -f 'TMPNAM.C' -a "${1}" != "-c" ; then 
  1212.   echo shar: Will not clobber existing file \"'TMPNAM.C'\"
  1213. else
  1214. echo shar: Extracting \"'TMPNAM.C'\" \(420 characters\)
  1215. sed "s/^X//" >'TMPNAM.C' <<'END_OF_FILE'
  1216. X/*
  1217. X** vn news reader.
  1218. X**
  1219. X** tmpnam.c - tmpnam() replacement for UCB, also uses non-generic name.
  1220. X**
  1221. X** see copyright disclaimer / history in vn.c source file
  1222. X*/
  1223. X
  1224. X#include <stdio.h>
  1225. X#include "config.h"
  1226. X
  1227. Xchar *tmpnam (buf)
  1228. Xchar *buf;
  1229. X{
  1230. X    static char *ptr = VNTEMPNAME;
  1231. X
  1232. X    /* depends on string initialized above */
  1233. X    sprintf (ptr+TMP_XOFFSET,"XXXXXX");
  1234. X
  1235. X    mktemp (ptr);
  1236. X
  1237. X    if (buf != NULL)
  1238. X        strcpy (buf,ptr);
  1239. X
  1240. X    return (ptr);
  1241. X}
  1242. END_OF_FILE
  1243. if test 420 -ne `wc -c <'TMPNAM.C'`; then
  1244.     echo shar: \"'TMPNAM.C'\" unpacked with wrong size!
  1245. fi
  1246. # end of 'TMPNAM.C'
  1247. fi
  1248. if test -f 'TTY.H' -a "${1}" != "-c" ; then 
  1249.   echo shar: Will not clobber existing file \"'TTY.H'\"
  1250. else
  1251. echo shar: Extracting \"'TTY.H'\" \(511 characters\)
  1252. sed "s/^X//" >'TTY.H' <<'END_OF_FILE'
  1253. X/*
  1254. X** vn news reader.
  1255. X**
  1256. X** tty.h - codes for tty_set and term_set
  1257. X**
  1258. X** see copyright disclaimer / history in vn.c source file
  1259. X*/
  1260. X
  1261. X#define MOVE 100
  1262. X#define ERASE 101
  1263. X#define START 102
  1264. X#define STOP 103
  1265. X#define RUBSEQ 104
  1266. X#define ZAP 105
  1267. X#define ONREVERSE 106
  1268. X#define OFFREVERSE 107
  1269. X#define RESTART 108
  1270. X
  1271. X#define RAWMODE 200
  1272. X#ifndef    MINIX
  1273. X#define COOKED 201
  1274. X#else
  1275. X#define XCOOKED 201
  1276. X#endif
  1277. X#define SAVEMODE 202
  1278. X#define RESTORE 203
  1279. X#define BACKSTOP 204
  1280. X
  1281. X#ifdef amiga
  1282. X#undef putchar
  1283. X#define putchar ttputc
  1284. X#endif
  1285. X
  1286. END_OF_FILE
  1287. if test 511 -ne `wc -c <'TTY.H'`; then
  1288.     echo shar: \"'TTY.H'\" unpacked with wrong size!
  1289. fi
  1290. # end of 'TTY.H'
  1291. fi
  1292. if test -f 'TUNE.H' -a "${1}" != "-c" ; then 
  1293.   echo shar: Will not clobber existing file \"'TUNE.H'\"
  1294. else
  1295. echo shar: Extracting \"'TUNE.H'\" \(2258 characters\)
  1296. sed "s/^X//" >'TUNE.H' <<'END_OF_FILE'
  1297. X/*
  1298. X** vn news reader.
  1299. X**
  1300. X** tune.h - system tuning parameters
  1301. X**
  1302. X** see copyright disclaimer / history in vn.c source file
  1303. X*/
  1304. X
  1305. X/*
  1306. X**    buffer size needed for tmpnam()
  1307. X*/
  1308. X#ifndef L_tmpnam
  1309. X#define L_tmpnam 48
  1310. X#endif
  1311. X
  1312. X/*
  1313. X** hash table size.  linked list type of table which can expand to
  1314. X** arbitrary density, including densities > 100%.  Number of entries
  1315. X** will be number of newsgroups in active list.  This should be a prime
  1316. X** number ("long division" of string modulo table size hash function).
  1317. X*/
  1318. X#define HASHSIZE 809
  1319. X
  1320. X/*
  1321. X**    maximum number of columns on terminal.  If made smaller, there
  1322. X**    will be a savings in the size of the temporary file used
  1323. X**    for holding displays, at the penalty of not being able to use
  1324. X**    the entire screen width on terminals actually possessing more
  1325. X**    columns than this.  A block roughly on the order of this value
  1326. X**    times the number of lines the terminal has is maintained per page in
  1327. X**    the temp file, and read / written as displays are interacted
  1328. X**    with.  MIN_C put here because MAX_C > MIN_C.  MIN_C is the minumum
  1329. X**    number of columns for which a "reasonable" display can be produced.
  1330. X**    before making it smaller, look at all uses of C_allow and variable
  1331. X**    to see that a setting that small won't screw up array bounds.
  1332. X*/
  1333. X#define MAX_C 132
  1334. X#define MIN_C 36
  1335. X
  1336. X/*
  1337. X**    large size for general purpose local buffers.  only used in automatic
  1338. X**    variable declarations.  Used with fgets for buffer size when reading
  1339. X**    file records, to hold pathnames, commands, etc.  Reduce if you blow
  1340. X**    out stack storage.  If reduced too far, may eventually show up
  1341. X**    as syntax errors on interacting with vns_ routines, or command line
  1342. X**    botches.
  1343. X*/
  1344. X#define RECLEN 1200
  1345. X
  1346. X/* block sizes for allocation routines */
  1347. X#define STRBLKSIZE 1800    /* string storage allocation block */
  1348. X#define NDBLKSIZE 50    /* NODE structures to allocate at a time */
  1349. X
  1350. X/*
  1351. X** maximum number of articles to allow for processing in a single user
  1352. X** list.  Used only to declare an array of pointers on the stack, so it
  1353. X** can be fair sized without much problem.  In practicality, there is
  1354. X** no use for it being larger than the greatest line length available
  1355. X** on the CRT's being used.
  1356. X*/
  1357. X#define MAXARTLIST 200
  1358. X
  1359. X#ifdef amiga
  1360. X#undef putchar
  1361. X#define putchar ttputc
  1362. X#endif
  1363. X
  1364. END_OF_FILE
  1365. if test 2258 -ne `wc -c <'TUNE.H'`; then
  1366.     echo shar: \"'TUNE.H'\" unpacked with wrong size!
  1367. fi
  1368. # end of 'TUNE.H'
  1369. fi
  1370. if test -f 'USERLIST.C' -a "${1}" != "-c" ; then 
  1371.   echo shar: Will not clobber existing file \"'USERLIST.C'\"
  1372. else
  1373. echo shar: Extracting \"'USERLIST.C'\" \(2262 characters\)
  1374. sed "s/^X//" >'USERLIST.C' <<'END_OF_FILE'
  1375. X/*
  1376. X** vn news reader.
  1377. X**
  1378. X** userlist.c - generate user's list of articles
  1379. X**
  1380. X** see copyright disclaimer / history in vn.c source file
  1381. X*/
  1382. X
  1383. X#include <stdio.h>
  1384. X#include "tune.h"
  1385. X#include "node.h"
  1386. X#include "page.h"
  1387. X#include "vn.h"
  1388. X
  1389. Xextern PAGE Page;
  1390. Xextern char *List_sep;
  1391. X
  1392. X#ifndef    MINIX
  1393. Xstatic char Pattern[MAX_C] = "";
  1394. X#else
  1395. X/* Minix, in its C compiler wisdom(?), only defines 1 word for the above */
  1396. Xstatic char Pattern[MAX_C] = {0};
  1397. X#endif
  1398. X
  1399. X/*
  1400. X    generate user list of articles - either article numbers
  1401. X    are input directly (numeric list), or input is a search
  1402. X    string - invoke regular expression library and examine titles
  1403. X    search string "*" reserved for marked articles.  Strings may
  1404. X    be prefixed with '!' for negation.
  1405. X*/
  1406. Xuserlist (list)
  1407. Xchar *list;
  1408. X{
  1409. X    int i,j,anum[RECLEN/2],acount;
  1410. X    char neg, *s, sbuf[MAX_C+1], *reg, *regex(), *regcmp(), *index(), *strtok();
  1411. X
  1412. X    user_str (sbuf,"Articles or title search string : ",1,Pattern);
  1413. X    if (sbuf[0] == '!')
  1414. X    {
  1415. X        neg = '!';
  1416. X        s = sbuf+1;
  1417. X    }
  1418. X    else
  1419. X    {
  1420. X        neg = '\0';
  1421. X        s = sbuf;
  1422. X    }
  1423. X    for (i=0; s[i] != '\0'; ++i)
  1424. X    {
  1425. X        if (index(List_sep,s[i]) == NULL)
  1426. X        {
  1427. X            if (s[i] < '0' || s[i] > '9')
  1428. X                break;
  1429. X        }
  1430. X    }
  1431. X    acount = 0;
  1432. X
  1433. X    if (s[i] == '\0')
  1434. X    {
  1435. X        for (s = strtok(s,List_sep); s != NULL; s = strtok(NULL,List_sep))
  1436. X        {
  1437. X            anum[acount] = atoi(s);
  1438. X            ++acount;
  1439. X        }
  1440. X    }
  1441. X    else
  1442. X    {
  1443. X        /* we save old input only if NOT a list of article numbers */
  1444. X        strcpy(Pattern,sbuf);
  1445. X        if (s[0] == ART_MARK)
  1446. X        {
  1447. X            for (i=0; i < Page.h.artnum; ++i)
  1448. X            {
  1449. X                if (Page.b[i].art_mark != ' ')
  1450. X                {
  1451. X                    anum[acount] = Page.b[i].art_id;
  1452. X                    ++acount;
  1453. X                }
  1454. X            }
  1455. X        }
  1456. X        else
  1457. X        {
  1458. X            reg = regcmp(s,(char *) 0);
  1459. X            if (reg != NULL)
  1460. X            {
  1461. X                for (i=0; i < Page.h.artnum; ++i)
  1462. X                {
  1463. X                    if (regex(reg,Page.b[i].art_t) != NULL)
  1464. X                    {
  1465. X                        anum[acount] = Page.b[i].art_id;
  1466. X                        ++acount;
  1467. X                    }
  1468. X                }
  1469. X                regfree (reg);
  1470. X            }
  1471. X            else
  1472. X                preinfo ("bad regular expression syntax");
  1473. X        }
  1474. X    }
  1475. X
  1476. X    /* algorithm is inefficient, but we're only handling a few numbers */
  1477. X    *list = '\0';
  1478. X    for (i=0; i < Page.h.artnum; ++i)
  1479. X    {
  1480. X        for (j=0; j < acount && anum[j] != Page.b[i].art_id; ++j)
  1481. X            ;
  1482. X        if (neg == '!')
  1483. X        {
  1484. X            if (j < acount)
  1485. X                continue;
  1486. X        }
  1487. X        else
  1488. X        {
  1489. X            if (j >= acount)
  1490. X                continue;
  1491. X        }
  1492. X        sprintf (list,"%d ",Page.b[i].art_id);
  1493. X        list += strlen(list);
  1494. X    }
  1495. X}
  1496. END_OF_FILE
  1497. if test 2262 -ne `wc -c <'USERLIST.C'`; then
  1498.     echo shar: \"'USERLIST.C'\" unpacked with wrong size!
  1499. fi
  1500. # end of 'USERLIST.C'
  1501. fi
  1502. if test -f 'VN.H' -a "${1}" != "-c" ; then 
  1503.   echo shar: Will not clobber existing file \"'VN.H'\"
  1504. else
  1505. echo shar: Extracting \"'VN.H'\" \(1423 characters\)
  1506. sed "s/^X//" >'VN.H' <<'END_OF_FILE'
  1507. X/*
  1508. X** vn news reader.
  1509. X**
  1510. X** vn.h - general parameters
  1511. X**
  1512. X** see copyright disclaimer / history in vn.c source file
  1513. X*/
  1514. X
  1515. X#define TRUE 1
  1516. X#define FALSE 0
  1517. X
  1518. X#define ED_MARK '>'
  1519. X#define ART_MARK '*'
  1520. X#define ART_WRITTEN '_'
  1521. X#define ART_UNWRITTEN ' '
  1522. X
  1523. X
  1524. X#define ANFLINES 1
  1525. X#define UDKFORM "undefined key - %c for help"
  1526. X#define HELPFORM "%c for help"
  1527. X
  1528. X/*
  1529. X    command characters - don't use numerics or <ESC>
  1530. X    ALTSAVE is a hack to avoid having to use ctl-s - XON/XOFF.
  1531. X    Wanted to preserve "s" pneumonic and lower / control /cap
  1532. X    convention.
  1533. X*/
  1534. X#define DIGEST 'd'
  1535. X#define UP 'k'
  1536. X#define DOWN 'j'
  1537. X#define FORWARD '\012'
  1538. X#define BACK '\010'
  1539. X#define GRPFORWARD '>'
  1540. X#define GRPBACK '<'
  1541. X#define READ 'r'
  1542. X#define ALTREAD ' '
  1543. X#define READALL 'R'
  1544. X#define READSTRING '\022'
  1545. X#define SAVE 's'
  1546. X#define SAVEALL 'S'
  1547. X#define SAVESTRING '\023'
  1548. X#define ALTSAVE '\024'
  1549. X#define PRINT 'p'
  1550. X#define PRINTALL 'P'
  1551. X#define PRINTSTRING '\020'
  1552. X#define MARK 'x'
  1553. X#define UNMARK 'X'
  1554. X#define MARKSTRING '\030'
  1555. X#define REDRAW '\014'
  1556. X#define QUIT 'q'
  1557. X#define SSTAT '#'
  1558. X#define GRPLIST '%'
  1559. X#define ORGGRP 'o'
  1560. X#define ORGSTAT 'O'
  1561. X#define UPDATE 'w'
  1562. X#define UNSUBSCRIBE 'u'
  1563. X#define UPALL 'W'
  1564. X#define UPSEEN '\027'
  1565. X#define UNESC '!'
  1566. X#define NEWGROUP 'n'
  1567. X#define HEADTOG 'h'
  1568. X#define SETROT 'z'
  1569. X#define HELP '?'
  1570. X#define TOPMOVE 'H'
  1571. X#define BOTMOVE 'L'
  1572. X#define ALTBOTTOM 'G'
  1573. X#define MIDMOVE 'M'
  1574. X#define PRTVERSION '"'
  1575. X
  1576. X#ifdef amiga
  1577. X#undef putchar
  1578. X#define putchar ttputc
  1579. X#endif
  1580. X
  1581. END_OF_FILE
  1582. if test 1423 -ne `wc -c <'VN.H'`; then
  1583.     echo shar: \"'VN.H'\" unpacked with wrong size!
  1584. fi
  1585. # end of 'VN.H'
  1586. fi
  1587. if test -f 'VNGLOB.C' -a "${1}" != "-c" ; then 
  1588.   echo shar: Will not clobber existing file \"'VNGLOB.C'\"
  1589. else
  1590. echo shar: Extracting \"'VNGLOB.C'\" \(1600 characters\)
  1591. sed "s/^X//" >'VNGLOB.C' <<'END_OF_FILE'
  1592. X/*
  1593. X** vn news reader.
  1594. X**
  1595. X** vnglob.c - global variables - see string.c also
  1596. X**
  1597. X** see copyright disclaimer / history in vn.c source file
  1598. X*/
  1599. X
  1600. X#include <stdio.h>
  1601. X#include "config.h"
  1602. X#include "head.h"
  1603. X#include "tune.h"
  1604. X#include "node.h"
  1605. X#include "page.h"
  1606. X
  1607. X/*
  1608. X    global data structure
  1609. X*/
  1610. XNODE **Newsorder = NULL;    /* in order of fw_group calls */
  1611. X
  1612. Xchar *Editor, *Ps1, *Printer;
  1613. X
  1614. Xint (*Massage)() = NULL;
  1615. Xint (*Postfunc)() = NULL;
  1616. Xint (*Mailfunc)() = NULL;
  1617. Xchar (*Marker)() = NULL;
  1618. Xint (*Hookfunc)() = NULL;
  1619. Xchar *(*Hookhelp)() = NULL;
  1620. XFILE *(*Saveopen)() = NULL;
  1621. Xint (*Digsaver)() = NULL;
  1622. X
  1623. Xchar Erasekey, Killkey;        /* user keys from stty */
  1624. Xchar *Orgdir;            /* .newsrc file, and original pwd */
  1625. Xchar *Savefile = DEF_SAVE;    /* file in which to save articles */
  1626. Xchar *Savedir;            /* default directory for saved articles */
  1627. Xchar *Ccfile;            /* author_copy file, stored /bin/mail fmt */
  1628. Xchar *Home;            /* user's home */
  1629. X
  1630. Xint Rot;    /* rotation */
  1631. Xint Headflag;    /* header printing flag */
  1632. Xint Digest;    /* if non-zero, digest article */
  1633. Xint More;    /* if non-zero, clear screen between each page.  Set by */
  1634. X        /* user's MORE environment variable; if `-c', then set true */
  1635. X
  1636. Xchar *Ku, *Kd, *Kl, *Kr;    /* Cursor movement capabilities */
  1637. X
  1638. X/* character translation arrays for commands */
  1639. Xchar Cxitop[CHMASK+1], Cxitor[CHMASK+1], Cxrtoi[CHMASK+1], Cxptoi[CHMASK+1];
  1640. X
  1641. X/*
  1642. X    cur_page - current page displayed;
  1643. X    lrec - last record
  1644. X    l_allow - lines allowed for article display
  1645. X    c_allow - columns allowed
  1646. X    ncount = newsorder index
  1647. X*/
  1648. Xint Cur_page, Lrec, L_allow, C_allow, Ncount;
  1649. X
  1650. Xint Nounsub, Listfirst;
  1651. X/*
  1652. X    current page
  1653. X*/
  1654. XPAGE Page;
  1655. END_OF_FILE
  1656. if test 1600 -ne `wc -c <'VNGLOB.C'`; then
  1657.     echo shar: \"'VNGLOB.C'\" unpacked with wrong size!
  1658. fi
  1659. # end of 'VNGLOB.C'
  1660. fi
  1661. if test -f 'active' -a "${1}" != "-c" ; then 
  1662.   echo shar: Will not clobber existing file \"'active'\"
  1663. else
  1664. echo shar: Extracting \"'active'\" \(614 characters\)
  1665. sed "s/^X//" >'active' <<'END_OF_FILE'
  1666. Xaus.computers.amiga 1510 1000 48
  1667. Xcomp.binaries.amiga 454
  1668. Xcomp.sources.amiga 358
  1669. Xalt.sources.amiga 2
  1670. Xcomp.sys.amiga.reviews 1
  1671. Xcomp.sys.amiga 36633
  1672. Xcomp.sys.amiga.misc 1030
  1673. Xcomp.sys.amiga.announce 28
  1674. Xcomp.sys.amiga.tech 14822
  1675. Xcomp.sys.amiga.programmer 991
  1676. Xcomp.unix.amiga 254
  1677. Xalt.sys.amiga.uucp 1
  1678. Xalt.sys.amiga.uucp.patches 1
  1679. Xcomp.sys.amiga.introduction 171
  1680. Xcomp.sys.amiga.marketplace 244
  1681. Xcomp.sys.amiga.hardware 6422
  1682. Xcomp.sys.amiga.applications 292
  1683. Xcomp.sys.amiga.audio 195
  1684. Xcomp.sys.amiga.multimedia 91
  1685. Xcomp.sys.amiga.graphics 305
  1686. Xcomp.sys.amiga.datacomm 513
  1687. Xcomp.sys.amiga.emulations 229
  1688. Xcomp.sys.amiga.games 4271
  1689. END_OF_FILE
  1690. if test 614 -ne `wc -c <'active'`; then
  1691.     echo shar: \"'active'\" unpacked with wrong size!
  1692. fi
  1693. # end of 'active'
  1694. fi
  1695. if test -f 'config.c' -a "${1}" != "-c" ; then 
  1696.   echo shar: Will not clobber existing file \"'config.c'\"
  1697. else
  1698. echo shar: Extracting \"'config.c'\" \(1505 characters\)
  1699. sed "s/^X//" >'config.c' <<'END_OF_FILE'
  1700. X
  1701. X/*
  1702. X *  CONFIG.C
  1703. X *
  1704. X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  1705. X *
  1706. X *  Extract fields from UULIB:Config
  1707. X */
  1708. X
  1709. X#include <stdio.h>
  1710. X#include <stdlib.h>
  1711. X#include <config.h>
  1712. X
  1713. X#define CTLZ    ('z'&0x1F)
  1714. X
  1715. Xstatic char *ConfBuf = NULL;
  1716. X
  1717. Xchar *
  1718. XFindConfig(field)
  1719. Xchar *field;
  1720. X{
  1721. X    char *str;
  1722. X    short flen = strlen(field);
  1723. X
  1724. X    if (ConfBuf == NULL) {
  1725. X    FILE *fi = fopen("UULIB:Config", "r");
  1726. X    if (fi) {
  1727. X        long buflen;
  1728. X        fseek(fi, 0L, 2);
  1729. X        buflen = ftell(fi);
  1730. X        fseek(fi, 0L, 0);
  1731. X        if (buflen > 0 && (ConfBuf = malloc(buflen + 1))) {
  1732. X        fread(ConfBuf, buflen, 1, fi);
  1733. X        ConfBuf[buflen] = CTLZ;     /*    can't use \0 */
  1734. X        for (str = ConfBuf; *str; ++str) {
  1735. X            char *bup;
  1736. X            if (*str == '\n') {     /*  make separate strs */
  1737. X            *str = 0;
  1738. X                        /*    remove white space at end */
  1739. X            for (bup = str - 1; bup >= ConfBuf && (*bup == ' ' || *bup == 9); --bup)
  1740. X                *bup = 0;
  1741. X            }
  1742. X        }
  1743. X        } else {
  1744. X        ConfBuf = NULL;
  1745. X        }
  1746. X    }
  1747. X    }
  1748. X    if (ConfBuf == NULL)
  1749. X    return(NULL);
  1750. X    /*
  1751. X     *    Search ConfBuf for Field<space/tab>
  1752. X     */
  1753. X
  1754. X    for (str = ConfBuf; *str != CTLZ; str += strlen(str) + 1) {
  1755. X    if (*str == 0)
  1756. X        continue;
  1757. X    if (strncmp(str, field, flen) == 0 && (str[flen] == ' ' || str[flen] == '\t')) {
  1758. X        str += flen;
  1759. X        while (*str == ' ' || *str == 9)
  1760. X        ++str;
  1761. X        return(str);
  1762. X    }
  1763. X    }
  1764. X    return(NULL);
  1765. X}
  1766. X
  1767. Xchar *
  1768. XGetConfig(field, def)
  1769. Xchar *field;
  1770. Xchar *def;
  1771. X{
  1772. X    char *result = FindConfig(field);
  1773. X
  1774. X    if (result == NULL)
  1775. X    result = def;
  1776. X    return(result);
  1777. X}
  1778. X
  1779. END_OF_FILE
  1780. if test 1505 -ne `wc -c <'config.c'`; then
  1781.     echo shar: \"'config.c'\" unpacked with wrong size!
  1782. fi
  1783. # end of 'config.c'
  1784. fi
  1785. if test -f 'config_std.h' -a "${1}" != "-c" ; then 
  1786.   echo shar: Will not clobber existing file \"'config_std.h'\"
  1787. else
  1788. echo shar: Extracting \"'config_std.h'\" \(2898 characters\)
  1789. sed "s/^X//" >'config_std.h' <<'END_OF_FILE'
  1790. X/*
  1791. X** default news poster
  1792. X*/
  1793. X#define DEF_POST "/usr/lib/news/inews -h"
  1794. X
  1795. X/*
  1796. X** default user .newsrc file
  1797. X*/
  1798. X#ifdef    MSDOS
  1799. X#define DEF_NEWSRC "_newsrc"
  1800. X#else
  1801. X#define DEF_NEWSRC ".newsrc"
  1802. X#endif
  1803. X
  1804. X/*
  1805. X** If INLETTER is defined, the address line will be placed into the
  1806. X** file editted by the user, and the mailer is assumed smart enough
  1807. X** to understand about header lines in the file.  Otherwise the
  1808. X** address is part of the mailer's command line.
  1809. X**
  1810. X** if MAILSMART is defined, The From: line will be used for mail replies,
  1811. X** or overridden by a "Reply-to:" line if present - "Path:" will be used
  1812. X** as a last resort.  If MAILSMART is not defined, "Path:" will simply be
  1813. X** used.
  1814. X**
  1815. X** if MAILCHOOSE is defined, the user is prompted before edit with all
  1816. X** of the address lines to choose from, or to input a new one.  MAILCHOOSE
  1817. X** makes MAILSMART irrelevant, but the two are independent of INLETTER.
  1818. X**
  1819. X*/
  1820. X#define MAILSMART
  1821. X#define INLETTER
  1822. X
  1823. X/*
  1824. X** default mail sender.  If INLETTER, will be done as
  1825. X** cat <file> | DEF_MAIL,  Otherwise, cat <file> | DEF_MAIL <address>
  1826. X** user's MAILER variable will have to conform, too.
  1827. X*/
  1828. X#ifdef INLETTER
  1829. X#define DEF_MAIL "/usr/lib/sendmail -t"
  1830. X#else
  1831. X#define DEF_MAIL "/bin/mail"
  1832. X#endif
  1833. X
  1834. X/* OLDRC defined for an apparently earlier news version which took unnamed
  1835. X** command line options as synonyms for -n, and did not take ranges in
  1836. X** the .newsrc file.  Probably useless, but kept in for historical reasons.
  1837. X**
  1838. X**#define OLDRC
  1839. X*/
  1840. X
  1841. X/*
  1842. X** article spool directory
  1843. X*/
  1844. X#define SPOOLDIR "news:"
  1845. X
  1846. X/*
  1847. X** active file
  1848. X*/
  1849. X#define ACTFILE "news:active"
  1850. X
  1851. X/*
  1852. X** maximum number of option lines in .newsrc
  1853. X*/
  1854. X#define OPTLINES 20
  1855. X
  1856. X/*
  1857. X** maximum number of filter options
  1858. X*/
  1859. X#define NUMFILTER 30
  1860. X
  1861. X/*
  1862. X** maximum number of file lines to search looking for header lines.
  1863. X*/
  1864. X#define HDR_LINES 36
  1865. X
  1866. X/*
  1867. X** When a newsgroup is scanned, we ignore articles less than <high spool> -
  1868. X** MAXARTRANGE.  This is intended to prevent ridiculous numbers of article
  1869. X** opening attempts the first time a user reads a new newsgroup which has a
  1870. X** huge difference between the high and low spool numbers, perhaps due to
  1871. X** some articles not getting expired.
  1872. X*/
  1873. X#define MAXARTRANGE 1600    /* about 2 weeks of soc.singles */
  1874. X
  1875. X/*
  1876. X** If we detect that the user has a higher number in .newsrc than the
  1877. X** high article number, obviously the active file is out of synch with the
  1878. X** .newsrc.  We set the user's number back to the low article number in
  1879. X** this case, on the theory that it's better to repeat stuff than miss
  1880. X** articles.  On such setbacks, we won't backdate the user by more than
  1881. X** SYN_SETBACK articles, preventing floods of articles on large newsgroups
  1882. X** if you don't define SYN_CHECK, the user's number won't be adjusted in
  1883. X** this case, choosing to lose articles rather than show old ones.
  1884. X*/
  1885. X#define SYN_CHECK
  1886. X#define SYN_SETBACK 60
  1887. X
  1888. X#ifdef amiga
  1889. X#undef putchar
  1890. X#define putchar ttputc
  1891. X#endif
  1892. X
  1893. END_OF_FILE
  1894. if test 2898 -ne `wc -c <'config_std.h'`; then
  1895.     echo shar: \"'config_std.h'\" unpacked with wrong size!
  1896. fi
  1897. # end of 'config_std.h'
  1898. fi
  1899. if test -f 'dfiles' -a "${1}" != "-c" ; then 
  1900.   echo shar: Will not clobber existing file \"'dfiles'\"
  1901. else
  1902. echo shar: Extracting \"'dfiles'\" \(338 characters\)
  1903. sed "s/^X//" >'dfiles' <<'END_OF_FILE'
  1904. Xdlib:c.o
  1905. Xamiga.o
  1906. Xconfig.o
  1907. Xdigest.o
  1908. Xenvir_set.o
  1909. Xgetch.o
  1910. Xhash.o
  1911. Xhelp.o
  1912. Xnewdisp.o
  1913. Xpagefile.o
  1914. Xprintex.o
  1915. Xreader.o
  1916. Xreg.o
  1917. Xregcompat.o
  1918. Xregexp.o
  1919. Xsession.o
  1920. Xsig_set.o
  1921. Xstat.o
  1922. Xstd.o
  1923. Xstorage.o
  1924. Xstrings.o
  1925. Xsvart.o
  1926. Xtermcap.o
  1927. Xterm_set.o
  1928. Xtty_set.o
  1929. Xuserlist.o 
  1930. Xvn.o
  1931. Xvnglob.o
  1932. Xstat2.o
  1933. Xgetenv.o
  1934. Xrand.o
  1935. Xmktemp.o
  1936. Xdlib:c.lib dlib:amigas.lib dlib:auto.lib
  1937. Xdlib:x.o
  1938. X
  1939. END_OF_FILE
  1940. if test 338 -ne `wc -c <'dfiles'`; then
  1941.     echo shar: \"'dfiles'\" unpacked with wrong size!
  1942. fi
  1943. # end of 'dfiles'
  1944. fi
  1945. if test -f 'envx' -a "${1}" != "-c" ; then 
  1946.   echo shar: Will not clobber existing file \"'envx'\"
  1947. else
  1948. echo shar: Extracting \"'envx'\" \(1193 characters\)
  1949. sed "s/^X//" >'envx' <<'END_OF_FILE'
  1950. X   amiga.c..
  1951. X   config.c..
  1952. X   DIGEST.C..
  1953. X   envir_set.c..
  1954. X    50     char *vn_env(), *getcwd(), *str_store();
  1955. X    56     Ps1 = vn_env("PS1",DEF_PS1);
  1956. X    57     Editor = vn_env("EDITOR",DEF_ED);
  1957. X    58     Printer = vn_env("PRINTER",DEF_PRINT);
  1958. X    59     ccname = vn_env("CCFILE",DEF_CCFILE);
  1959. X    60     keyxln = vn_env("VNKEY",DEF_KEYXLN);
  1960. X    61     Savedir = vn_env("VNSAVE",NULL);
  1961. X    62     More = (strcmp(vn_env("MORE",""), "-c") == 0 ? TRUE : FALSE);
  1962. X   107 vn_env(var,def)
  1963. X   getch.c..
  1964. X   getenv.c..
  1965. X   getren.c..
  1966. X   gettoc.c..
  1967. X   hash.c..
  1968. X   help.c..
  1969. X   mktemp.c..
  1970. X   MSDOS.C..
  1971. X   newdisp.c..
  1972. X   pagefile.c..
  1973. X   printex.c..
  1974. X   rand.c..
  1975. X   reader.c..
  1976. X   REG.C..
  1977. X   regcompat.c..
  1978. X   regexp.c..
  1979. X   rnumbox.c..
  1980. X   session.c..
  1981. X   sig_set.c..
  1982. X   stat.c..
  1983. X   stat2.c..
  1984. X   std.c..
  1985. X    95     char *vn_env();
  1986. X   108     rcname = vn_env("MAILER",DEF_MAIL);
  1987. X   116     rcname = vn_env("VNPOSTER",DEF_POST);
  1988. X   119     rcname = vn_env("NEWSRC",DEF_NEWSRC);
  1989. X   STORAGE.C..
  1990. X   STRINGS.C..
  1991. X   STRTOK.C..
  1992. X   svart.c..
  1993. X   termcap.c..
  1994. X   term_set.c..
  1995. X    53     char *tgetstr(), *vn_env(), *str_store();
  1996. X    58     tvar = vn_env("TERM",DEF_TERM);
  1997. X   TMPNAM.C..
  1998. X   tty_set.c..
  1999. X   umbox.c..
  2000. X   updact.c..
  2001. X   USERLIST.C..
  2002. X   vn.c..
  2003. X   VNGLOB.C..
  2004. END_OF_FILE
  2005. if test 1193 -ne `wc -c <'envx'`; then
  2006.     echo shar: \"'envx'\" unpacked with wrong size!
  2007. fi
  2008. # end of 'envx'
  2009. fi
  2010. if test -f 'getch.c' -a "${1}" != "-c" ; then 
  2011.   echo shar: Will not clobber existing file \"'getch.c'\"
  2012. else
  2013. echo shar: Extracting \"'getch.c'\" \(2120 characters\)
  2014. sed "s/^X//" >'getch.c' <<'END_OF_FILE'
  2015. X/*
  2016. X** vn news reader.
  2017. X**
  2018. X** getch.c - character i/o routines
  2019. X**
  2020. X** see copyright disclaimer / history in vn.c source file
  2021. X*/
  2022. X#include <stdio.h>
  2023. X#include <setjmp.h>
  2024. X#include <ctype.h>
  2025. X#include "config.h"
  2026. X#include "vn.h"
  2027. X
  2028. Xextern char Cxitop[];
  2029. Xextern char *Ku, *Kd, *Kr, *Kl;
  2030. X
  2031. X#ifdef    MSDOS
  2032. X#undef    getc
  2033. X#define    getc(x)    getraw()
  2034. X#endif
  2035. X
  2036. X#ifdef    amiga
  2037. X#undef    getc
  2038. X#define    getc(x)    ttgetc()
  2039. X#endif
  2040. X
  2041. X/*
  2042. X    getkey obtains user keystroke with count from leading
  2043. X    numerics, if any.  Picks up arrow key sequences and maps
  2044. X    them to other keys.  Also translates character through
  2045. X    Cxitop array since this routine is only used in session
  2046. X    loop.  Saves untranslating arrow keys.
  2047. X*/
  2048. Xgetkey (c)
  2049. Xchar *c;
  2050. X{
  2051. X    int i, j;
  2052. X    static char    ckseq[32];
  2053. X
  2054. X#ifdef    MINIX
  2055. X    fflush(stdout);
  2056. X#endif
  2057. X
  2058. X    /* Check for leading count */
  2059. X    for (i = 0; isdigit(*c = getc(stdin) & CHMASK); i = i * 10 + *c - '0')
  2060. X        ;
  2061. X
  2062. X    /* @#$!!! flakey front ends that won't map newlines in raw mode */
  2063. X    if (*c == '\012' || *c == '\015')
  2064. X        *c = '\n';
  2065. X
  2066. X    /* @#$!!! flakey terminals which send control sequences for cursors! */
  2067. X    if( *c == '\033' )
  2068. X    {
  2069. X        /*
  2070. X        ** Check if part of cursor key input sequence
  2071. X        ** (pitch unknown escape sequences)
  2072. X        */
  2073. X        j = 0;
  2074. X        ckseq[j] = *c; ckseq[j+1] = '\0';
  2075. X        while(*c == Ku[j] || *c == Kd[j] || *c == Kl[j] || *c == Kr[j])
  2076. X        {
  2077. X            if( strcmp(ckseq, Ku) == 0 ) { *c = UP; break; }
  2078. X            if( strcmp(ckseq, Kd) == 0 ) { *c = DOWN; break; }
  2079. X#ifdef PAGEARROW
  2080. X            if( strcmp(ckseq, Kl) == 0 ) { *c = BACK; break; }
  2081. X            if( strcmp(ckseq, Kr) == 0 ) { *c = FORWARD; break; }
  2082. X#else
  2083. X            if( strcmp(ckseq, Kl) == 0 ) { *c = UP; break; }
  2084. X            if( strcmp(ckseq, Kr) == 0 ) { *c = DOWN; break; }
  2085. X#endif
  2086. X            *c = (getc(stdin) & CHMASK);
  2087. X            ckseq[++j] = *c; ckseq[j+1] = '\0';
  2088. X        }
  2089. X    }
  2090. X    else
  2091. X        *c = Cxitop[*c];
  2092. X
  2093. X    if (i <= 0)
  2094. X        i = 1;
  2095. X    return (i);
  2096. X}
  2097. X
  2098. X/*
  2099. X    get user key ignoring most controls.  Used from reader and other
  2100. X    non-screen interactions.
  2101. X*/
  2102. Xgetnoctl ()
  2103. X{
  2104. X    char c;
  2105. X
  2106. X#ifdef    MINIX
  2107. X    fflush(stdout);
  2108. X#endif
  2109. X    while (iscntrl(c = getc(stdin) & CHMASK))
  2110. X    {
  2111. X        if (c == '\015' || c == '\012')
  2112. X            c = '\n';
  2113. X        if (c == '\n' || c == '\b' || c == '\t')
  2114. X            return (c);
  2115. X    }
  2116. X    return ((int) c);
  2117. X}
  2118. END_OF_FILE
  2119. if test 2120 -ne `wc -c <'getch.c'`; then
  2120.     echo shar: \"'getch.c'\" unpacked with wrong size!
  2121. fi
  2122. # end of 'getch.c'
  2123. fi
  2124. if test -f 'getenv.c' -a "${1}" != "-c" ; then 
  2125.   echo shar: Will not clobber existing file \"'getenv.c'\"
  2126. else
  2127. echo shar: Extracting \"'getenv.c'\" \(815 characters\)
  2128. sed "s/^X//" >'getenv.c' <<'END_OF_FILE'
  2129. X
  2130. X/*
  2131. X *  GETENV.C
  2132. X *
  2133. X *  Lattice's screws up.
  2134. X *
  2135. X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  2136. X */
  2137. X
  2138. X#include <stdio.h>
  2139. X
  2140. Xchar *
  2141. Xgettmpenv(id)
  2142. Xchar *id;
  2143. X{
  2144. X    static char *buf;
  2145. X    static char *res = NULL;
  2146. X    long fh;
  2147. X    long len;
  2148. X
  2149. X    buf = (char *)malloc(strlen(id) + 8);
  2150. X    sprintf(buf, "ENV:%s", id);
  2151. X    fh = Open(buf, 1005);
  2152. X    free(buf);
  2153. X    if (fh) {
  2154. X    Seek(fh, 0L, 1);
  2155. X    len = Seek(fh, 0L, -1);
  2156. X    if (len < 0) {
  2157. X        Close(fh);
  2158. X        return(NULL);
  2159. X    }
  2160. X    if (res)
  2161. X        free(res);
  2162. X    res = (char *)malloc(len + 1);
  2163. X    Read(fh, res, len);
  2164. X    Close(fh);
  2165. X    res[len] = 0;
  2166. X    return(res);
  2167. X    }
  2168. X    return(NULL);
  2169. X}
  2170. X
  2171. Xchar *
  2172. Xgetenv(id)
  2173. Xchar *id;
  2174. X{
  2175. X    char *res = gettmpenv(id);
  2176. X    char *perm = NULL;
  2177. X
  2178. X    if (res) {
  2179. X    perm = (char *)malloc(strlen(res) + 1);
  2180. X    strcpy(perm, res);
  2181. X    }
  2182. X    return(perm);
  2183. X}
  2184. X
  2185. END_OF_FILE
  2186. if test 815 -ne `wc -c <'getenv.c'`; then
  2187.     echo shar: \"'getenv.c'\" unpacked with wrong size!
  2188. fi
  2189. # end of 'getenv.c'
  2190. fi
  2191. if test -f 'getren.c' -a "${1}" != "-c" ; then 
  2192.   echo shar: Will not clobber existing file \"'getren.c'\"
  2193. else
  2194. echo shar: Extracting \"'getren.c'\" \(1870 characters\)
  2195. sed "s/^X//" >'getren.c' <<'END_OF_FILE'
  2196. X/*--------------------------------------------------------------------- */
  2197. X/* getren.c                                */
  2198. X/*    Read each input file (a news article) and output a command to    */
  2199. X/*    rename it to the VnnIxxx from the Subject: line.        */
  2200. X/*                                    */
  2201. X/* History:                                */
  2202. X/*    6 Jan 1991    v1.0                        */
  2203. X/*                                    */
  2204. X/* Author:                                */
  2205. X/*    Eyal Lebedinsky                            */
  2206. X/*    Canberra, AUSTRALIA                        */
  2207. X/*--------------------------------------------------------------------- */
  2208. X
  2209. X#include <stdio.h>
  2210. X#include <stdlib.h>
  2211. X#include <string.h>
  2212. X#include <ctype.h>
  2213. X
  2214. X#define    VBUF
  2215. X
  2216. Xtypedef unsigned char    uchar;
  2217. X
  2218. Xstatic uchar    line[4096];
  2219. X
  2220. Xmain (argc, argv)
  2221. Xint    argc;
  2222. Xuchar    *argv[];
  2223. X{
  2224. X    FILE    *fin = NULL;
  2225. X    uchar    *q;
  2226. X    int    nopened = 0,
  2227. X        nrenamed = 0;
  2228. X#ifdef    VBUF
  2229. X    uchar    *p;
  2230. X#endif
  2231. X
  2232. X#ifdef    VBUF
  2233. X#define    BSIZE    1024    /* we do not expect to read much */
  2234. X    if ((p = malloc (BSIZE)) == NULL) {
  2235. X        fprintf (stderr, "Out of memory\n");
  2236. X        exit (1);
  2237. X    }
  2238. X#endif
  2239. X
  2240. X    for (; argc-- > 1;) {
  2241. X        fin = fopen (*++argv, "rt");
  2242. X        if (fin == NULL) {
  2243. X            fprintf (stderr, "could not open %s\n", *argv);
  2244. X            continue;
  2245. X        }
  2246. X#ifdef    VBUF
  2247. X        if (setvbuf (fin, p, _IOFBF, BSIZE)) {
  2248. X            fprintf (stderr, "setvbuf failed!\n");
  2249. X            exit (1);
  2250. X        }
  2251. X#endif
  2252. X        ++nopened;
  2253. X        while (fgets (line, sizeof (line), fin) != NULL) {
  2254. X            if (!memcmp (line, "Subject: ", 9)) {
  2255. X            q = line + 9;
  2256. X            if ((q[0] == 'v' || q[0] == 'V') &&
  2257. X                isdigit (q[1]) &&
  2258. X                isdigit (q[2]) &&
  2259. X                (q[3] == 'i' || q[3] == 'I') &&
  2260. X                (q[4] == 'n' || q[4] == 'N' || isdigit (q[4])) &&
  2261. X                (q[5] == 'f' || q[5] == 'F' || isdigit (q[5])) &&
  2262. X                isdigit (q[6]) &&
  2263. X                (q[7] == ':' || isdigit (q[7]) && q[8] == ':')) {
  2264. X                printf ("ren %s ", *argv);
  2265. X                for (; isalnum (*q); ++q)
  2266. X                     putchar (*q);
  2267. X                putchar ('\n');
  2268. X                ++nrenamed;
  2269. X            }
  2270. X            break;
  2271. X            }
  2272. X        }
  2273. X        fclose (fin);
  2274. X    }
  2275. X    fprintf (stderr, "%u files found, %u renamed\n",
  2276. X        nopened, nrenamed);
  2277. X    exit (0);
  2278. X}
  2279. END_OF_FILE
  2280. if test 1870 -ne `wc -c <'getren.c'`; then
  2281.     echo shar: \"'getren.c'\" unpacked with wrong size!
  2282. fi
  2283. # end of 'getren.c'
  2284. fi
  2285. if test -f 'gettoc.c' -a "${1}" != "-c" ; then 
  2286.   echo shar: Will not clobber existing file \"'gettoc.c'\"
  2287. else
  2288. echo shar: Extracting \"'gettoc.c'\" \(1394 characters\)
  2289. sed "s/^X//" >'gettoc.c' <<'END_OF_FILE'
  2290. X/*--------------------------------------------------------------------- */
  2291. X/* gettoc.c                                */
  2292. X/*    Reach each input file (an mbox format) and output some header    */
  2293. X/*    lines to be used as a Table Of Contents.            */
  2294. X/*                                    */
  2295. X/* History:                                */
  2296. X/*    6 Oct 1990    v1.0                        */
  2297. X/*                                    */
  2298. X/* Author:                                */
  2299. X/*    Eyal Lebedinsky                            */
  2300. X/*    Canberra, AUSTRALIA                        */
  2301. X/*--------------------------------------------------------------------- */
  2302. X
  2303. X#include <stdio.h>
  2304. X#include <stdlib.h>
  2305. X#include <string.h>
  2306. X
  2307. Xtypedef unsigned char    uchar;
  2308. X
  2309. Xstatic uchar    line[4096];
  2310. X
  2311. Xmain (argc, argv)
  2312. Xint    argc;
  2313. Xuchar    *argv[];
  2314. X{
  2315. X    FILE    *fin = NULL;
  2316. X#ifdef    VBUF
  2317. X    uchar    *p;
  2318. X#endif
  2319. X
  2320. X#ifdef    VBUF
  2321. X#define    BSIZE    20480
  2322. X    if ((p = (uchar *)malloc (BSIZE)) == NULL) {
  2323. X        fprintf (stderr, "Out of memory\n");
  2324. X        exit (1);
  2325. X    }
  2326. X#endif
  2327. X
  2328. X    for (; argc-- > 1;) {
  2329. X        fin = fopen (*++argv, "rt");
  2330. X        if (fin == NULL)
  2331. X            continue;
  2332. X#ifdef    VBUF
  2333. X        if (setvbuf (fin, p, _IOFBF, BSIZE)) {
  2334. X            fprintf (stderr, "setvbuf failed!\n");
  2335. X            exit (1);
  2336. X        }
  2337. X#endif
  2338. X        while (fgets (line, sizeof (line), fin) != NULL) {
  2339. X            if (!memcmp (line, "Keywords: ", 10) ||
  2340. X                !memcmp (line, "Subject: ", 9) ||
  2341. X                !memcmp (line, "Article ", 8) ||
  2342. X                !memcmp (line, ">From: ", 7) ||
  2343. X                !memcmp (line, "Lines: ", 7) ||
  2344. X                !memcmp (line, "From: ", 6) ||
  2345. X                !memcmp (line, "Date: ", 6))
  2346. X                fputs (line, stdout);
  2347. X        }
  2348. X        fclose (fin);
  2349. X    }
  2350. X    exit (0);
  2351. X}
  2352. END_OF_FILE
  2353. if test 1394 -ne `wc -c <'gettoc.c'`; then
  2354.     echo shar: \"'gettoc.c'\" unpacked with wrong size!
  2355. fi
  2356. # end of 'gettoc.c'
  2357. fi
  2358. if test -f 'hash.c' -a "${1}" != "-c" ; then 
  2359.   echo shar: Will not clobber existing file \"'hash.c'\"
  2360. else
  2361. echo shar: Extracting \"'hash.c'\" \(1909 characters\)
  2362. sed "s/^X//" >'hash.c' <<'END_OF_FILE'
  2363. X/*
  2364. X** vn news reader.
  2365. X**
  2366. X** hash.c - hash table routines
  2367. X**
  2368. X** see copyright disclaimer / history in vn.c source file
  2369. X*/
  2370. X
  2371. X#include <stdio.h>
  2372. X#include "config.h"
  2373. X#include "tune.h"
  2374. X#include "node.h"
  2375. X
  2376. X/*
  2377. X** hash table manipulation routines:
  2378. X*/
  2379. X
  2380. Xextern int Ncount;
  2381. Xextern NODE **Newsorder;
  2382. X
  2383. Xstatic NODE *Tab [HASHSIZE];    /* hash Table */
  2384. X
  2385. Xstatic unsigned hash ();
  2386. X
  2387. Xhashinit ()
  2388. X{
  2389. X    int i;
  2390. X    for (i=0; i < HASHSIZE; ++i)
  2391. X        Tab[i] = NULL;
  2392. X    Ncount = 0;
  2393. X}
  2394. X
  2395. X/*
  2396. X    enter new node (name s, articles n, low l) in hash Table, 
  2397. X    initial flags = 0.  Set order to -1.
  2398. X*/
  2399. XNODE *hashenter(s,n,l)
  2400. Xchar *s;
  2401. Xint n;
  2402. Xint l;
  2403. X{
  2404. X    char *str_store();
  2405. X    NODE *ptr,*node_store();
  2406. X    NODE *hashfind();
  2407. X    int i;
  2408. X
  2409. X    if ((ptr = hashfind(s)) != NULL)
  2410. X    {
  2411. X        fgprintf ("Warning: group %s encountered twice",s);
  2412. X        return (ptr);
  2413. X    }
  2414. X
  2415. X    i=hash(s);
  2416. X    ptr = node_store();
  2417. X    ptr->next = Tab[i];
  2418. X    Tab[i] = ptr;
  2419. X    if (l > n)
  2420. X        l = n;
  2421. X    ++Ncount;
  2422. X    ptr->lownum = l;
  2423. X    ptr->state = 0;
  2424. X    ptr->data = NULL;
  2425. X    ptr->flags = 0;
  2426. X    ptr->highnum = n;
  2427. X    ptr->nd_name = str_store(s);
  2428. X    ptr->pgshwn = 0;
  2429. X    ptr->order = -1;
  2430. X    return (ptr);
  2431. X}
  2432. X
  2433. XNODE *hashfind(s)
  2434. Xchar *s;
  2435. X{
  2436. X    NODE *ptr;
  2437. X
  2438. X    for (ptr = Tab[hash(s)]; ptr != NULL && strcmp(ptr->nd_name,s) != 0;
  2439. X                    ptr = ptr->next)
  2440. X            ;
  2441. X    return (ptr);
  2442. X}
  2443. X
  2444. Xmake_newsorder()
  2445. X{
  2446. X    char *malloc();
  2447. X    int i;
  2448. X    NODE *ptr;
  2449. X
  2450. X    if ((Newsorder = (NODE **) malloc(Ncount * sizeof(NODE *))) == NULL)
  2451. X        printex("Memory allocation failure - newsorder array");
  2452. X    for (i=0; i < Ncount; ++i)
  2453. X        Newsorder[i] = NULL;
  2454. X    for (i=0; i < HASHSIZE; ++i)
  2455. X    {
  2456. X        for (ptr = Tab[i]; ptr != NULL; ptr = ptr->next)
  2457. X        {
  2458. X            if (ptr->order < 0 || ptr->order >= Ncount)
  2459. X                printex("News order range error");
  2460. X            Newsorder[ptr->order] = ptr;
  2461. X        }
  2462. X    }
  2463. X    for (i=0; i < Ncount; ++i)
  2464. X        if (Newsorder[i] == NULL)
  2465. X            printex("News order duplication error");
  2466. X}
  2467. X
  2468. Xstatic
  2469. Xunsigned
  2470. Xhash (s)
  2471. Xchar *s;
  2472. X{
  2473. X    unsigned rem;
  2474. X    for (rem=0; *s != '\0'; ++s)
  2475. X        rem = (rem*128 + (*s&0x7f)) % HASHSIZE;
  2476. X    return (rem);
  2477. X}
  2478. END_OF_FILE
  2479. if test 1909 -ne `wc -c <'hash.c'`; then
  2480.     echo shar: \"'hash.c'\" unpacked with wrong size!
  2481. fi
  2482. # end of 'hash.c'
  2483. fi
  2484. if test -f 'mktemp.c' -a "${1}" != "-c" ; then 
  2485.   echo shar: Will not clobber existing file \"'mktemp.c'\"
  2486. else
  2487. echo shar: Extracting \"'mktemp.c'\" \(548 characters\)
  2488. sed "s/^X//" >'mktemp.c' <<'END_OF_FILE'
  2489. X/* mktemp - make a name for a temporary file */
  2490. X
  2491. X#include <stdio.h>
  2492. X#include <time.h>
  2493. X
  2494. Xchar *mktemp(template)
  2495. Xchar *template;
  2496. X{
  2497. X  int pid, k;
  2498. X  char *p;
  2499. X
  2500. X/*  pid = getpid();*/        /* get process id as semi-unique number */
  2501. X  srand (time (NULL));        /* get a random number using time as seed */
  2502. X  pid = rand ();
  2503. X  p = template;
  2504. X  while (*p++) ;        /* find end of string */
  2505. X  p--;                /* backup to last character */
  2506. X
  2507. X  /* Replace XXXXXX at end of template with pid. */
  2508. X  while (*--p == 'X') {
  2509. X    *p = '0' + (pid % 10);
  2510. X    pid = pid/10;
  2511. X  }
  2512. X  return(template);
  2513. X}
  2514. END_OF_FILE
  2515. if test 548 -ne `wc -c <'mktemp.c'`; then
  2516.     echo shar: \"'mktemp.c'\" unpacked with wrong size!
  2517. fi
  2518. # end of 'mktemp.c'
  2519. fi
  2520. if test -f 'newdisp.c' -a "${1}" != "-c" ; then 
  2521.   echo shar: Will not clobber existing file \"'newdisp.c'\"
  2522. else
  2523. echo shar: Extracting \"'newdisp.c'\" \(1175 characters\)
  2524. sed "s/^X//" >'newdisp.c' <<'END_OF_FILE'
  2525. X/*
  2526. X** vn news reader.
  2527. X**
  2528. X** newgroups.c - display list of new groups since user's last ession.
  2529. X**
  2530. X** see copyright disclaimer / history in vn.c source file
  2531. X*/
  2532. X
  2533. X#include <stdio.h>
  2534. X#include "config.h"
  2535. X#include "tty.h"
  2536. X#include "node.h"
  2537. X
  2538. Xextern NODE **Newsorder;
  2539. Xextern int Ncount, Lrec, C_allow;
  2540. X
  2541. X#ifdef amiga
  2542. Xextern char pr_buf[];
  2543. Xvoid ttputc ();
  2544. X#endif
  2545. X
  2546. Xnew_groups ()
  2547. X{
  2548. X    int i,wrem,w;
  2549. X    int max;
  2550. X    char fs[24],c_end;
  2551. X
  2552. X    max = 0;
  2553. X    for (i=0; i < Ncount; ++i)
  2554. X        if (((Newsorder[i])->flags & FLG_NEW) != 0 &&
  2555. X                (w = strlen((Newsorder[i])->nd_name)) > max)
  2556. X            max = w;
  2557. X    sprintf (fs,"%%-%ds%%c",max);
  2558. X
  2559. X    if (max <= 0)
  2560. X        return (0);
  2561. X
  2562. X    term_set (ERASE);
  2563. X#ifdef amiga
  2564. X    sprintf (pr_buf,"New newsgroups:\n");
  2565. X    tputs(pr_buf,1,ttputc);
  2566. X#else
  2567. X    printf ("New newsgroups:\n");
  2568. X#endif
  2569. X
  2570. X
  2571. X    wrem = C_allow;
  2572. X    for (i=0; i < Ncount; ++i)
  2573. X    {
  2574. X        if (((Newsorder[i])->flags & FLG_NEW) == 0)
  2575. X            continue;
  2576. X        if ((wrem -= max) < max)
  2577. X        {
  2578. X            wrem = C_allow;
  2579. X            c_end = '\n';
  2580. X        }
  2581. X        else
  2582. X            c_end = ' ';
  2583. X#ifdef amiga
  2584. X        sprintf (pr_buf,fs,(Newsorder[i])->nd_name,c_end);
  2585. X        tputs(pr_buf,1,ttputc);
  2586. X#else
  2587. X        printf (fs,(Newsorder[i])->nd_name,c_end);
  2588. X#endif
  2589. X    }
  2590. X    if (c_end != '\n')
  2591. X        putchar ('\n');
  2592. X
  2593. X    return (1);
  2594. X}
  2595. END_OF_FILE
  2596. if test 1175 -ne `wc -c <'newdisp.c'`; then
  2597.     echo shar: \"'newdisp.c'\" unpacked with wrong size!
  2598. fi
  2599. # end of 'newdisp.c'
  2600. fi
  2601. if test -f 'printex.c' -a "${1}" != "-c" ; then 
  2602.   echo shar: Will not clobber existing file \"'printex.c'\"
  2603. else
  2604. echo shar: Extracting \"'printex.c'\" \(800 characters\)
  2605. sed "s/^X//" >'printex.c' <<'END_OF_FILE'
  2606. X/*
  2607. X** vn news reader.
  2608. X**
  2609. X** printex.c - print fatal error message and exit.
  2610. X**
  2611. X** see copyright disclaimer / history in vn.c source file
  2612. X*/
  2613. X#include <stdio.h>
  2614. X#include <setjmp.h>
  2615. X#include "config.h"
  2616. X#include "tty.h"
  2617. X
  2618. Xextern int errno;    /* unix error number */
  2619. X
  2620. X/*
  2621. X    error/abnormal condition cleanup and abort routine
  2622. X    pass stack to printf
  2623. X*/
  2624. Xprintex (s,a,b,c,d,e,f)
  2625. Xchar *s;
  2626. Xlong a,b,c,d,e,f;
  2627. X{
  2628. X    static int topflag=0;
  2629. X    if (topflag == 0)
  2630. X    {
  2631. X        ++topflag;
  2632. X        term_set (STOP);
  2633. X#ifndef    MINIX
  2634. X        tty_set (COOKED);
  2635. X#else
  2636. X/* COOKED is defined in Minix! */
  2637. X        tty_set (XCOOKED);
  2638. X#endif
  2639. X#ifdef amiga
  2640. X        ttflush ();
  2641. X#else
  2642. X        fflush (stdout);
  2643. X#endif
  2644. X        fprintf (stderr,s,a,b,c,d,e,f);
  2645. X        fprintf (stderr," (error code %d)\n",errno);
  2646. X        vns_exit(1);
  2647. X        stat_end(-1);
  2648. X        exit (1);
  2649. X    }
  2650. X    else
  2651. X        fprintf (stderr,s,a,b,c,d,e,f);
  2652. X}
  2653. END_OF_FILE
  2654. if test 800 -ne `wc -c <'printex.c'`; then
  2655.     echo shar: \"'printex.c'\" unpacked with wrong size!
  2656. fi
  2657. # end of 'printex.c'
  2658. fi
  2659. if test -f 'pwd.h' -a "${1}" != "-c" ; then 
  2660.   echo shar: Will not clobber existing file \"'pwd.h'\"
  2661. else
  2662. echo shar: Extracting \"'pwd.h'\" \(51 characters\)
  2663. sed "s/^X//" >'pwd.h' <<'END_OF_FILE'
  2664. Xstruct passwd {
  2665. X    char    *pw_dir;
  2666. X    char    *pw_name;
  2667. X};
  2668. X
  2669. END_OF_FILE
  2670. if test 51 -ne `wc -c <'pwd.h'`; then
  2671.     echo shar: \"'pwd.h'\" unpacked with wrong size!
  2672. fi
  2673. # end of 'pwd.h'
  2674. fi
  2675. if test -f 'rand.c' -a "${1}" != "-c" ; then 
  2676.   echo shar: Will not clobber existing file \"'rand.c'\"
  2677. else
  2678. echo shar: Extracting \"'rand.c'\" \(328 characters\)
  2679. sed "s/^X//" >'rand.c' <<'END_OF_FILE'
  2680. X/*
  2681. X *    In environments where the operating system doesn't provide
  2682. X *    a random number generator, the following code may be useful.
  2683. X */
  2684. X
  2685. Xstatic unsigned long _seed = 1;
  2686. X
  2687. Xint rand()
  2688. X{
  2689. X    _seed = (_seed * 1103515245) + 12345;
  2690. X    return((unsigned int) ((_seed / 65536) % 32768));
  2691. X}
  2692. X
  2693. Xvoid srand(seed)
  2694. Xunsigned int seed;
  2695. X{
  2696. X    _seed = seed;
  2697. X}
  2698. END_OF_FILE
  2699. if test 328 -ne `wc -c <'rand.c'`; then
  2700.     echo shar: \"'rand.c'\" unpacked with wrong size!
  2701. fi
  2702. # end of 'rand.c'
  2703. fi
  2704. if test -f 'regcompat.c' -a "${1}" != "-c" ; then 
  2705.   echo shar: Will not clobber existing file \"'regcompat.c'\"
  2706. else
  2707. echo shar: Extracting \"'regcompat.c'\" \(1117 characters\)
  2708. sed "s/^X//" >'regcompat.c' <<'END_OF_FILE'
  2709. X/* regcompat.c */
  2710. X/* file: regcompat.c
  2711. X** author: Peter S. Housel 11/21/88
  2712. X** Compatibility routines for regular expressions. more.c uses the
  2713. X** re_comp() and re_exec() routines, while Minix only has regcomp() and
  2714. X** regexec() (from Henry Spencer's freely redistributable regexp package).
  2715. X** Note that the third argument to regexec() is a beginning-of-line flag
  2716. X** and was probably added by Andrew Tannenbaum. It will probably be ignored
  2717. X** if your copy of the regexp routines only expects two args.
  2718. X**/
  2719. X
  2720. X#include <regexp.h>
  2721. X/* following just for debugging #define NULL    0 */
  2722. X#include <stdio.h>
  2723. X
  2724. Xextern char *malloc();
  2725. X
  2726. Xstatic regexp *re_exp = NULL;    /* currently compiled regular expression */
  2727. Xstatic char *re_err = NULL;    /* current regexp error */
  2728. X
  2729. Xchar *re_comp(str)
  2730. Xchar *str;
  2731. X{
  2732. X if(str == NULL)
  2733. X    return NULL;
  2734. X
  2735. X if(re_exp != NULL)
  2736. X    free(re_exp);
  2737. X
  2738. X if((re_exp = regcomp(str)) != NULL)
  2739. X    return NULL;
  2740. X
  2741. X return re_err != NULL ? re_err : "string didn't compile";
  2742. X}
  2743. X
  2744. Xint re_exec(str)
  2745. Xchar *str;
  2746. X{
  2747. X if(re_exp == NULL)
  2748. X    return -1;
  2749. X return regexec(re_exp, str, 1);
  2750. X}
  2751. X
  2752. Xregerror(str)
  2753. Xchar *str;
  2754. X{
  2755. X re_err = str;
  2756. X}
  2757. END_OF_FILE
  2758. if test 1117 -ne `wc -c <'regcompat.c'`; then
  2759.     echo shar: \"'regcompat.c'\" unpacked with wrong size!
  2760. fi
  2761. # end of 'regcompat.c'
  2762. fi
  2763. if test -f 'regexp.h' -a "${1}" != "-c" ; then 
  2764.   echo shar: Will not clobber existing file \"'regexp.h'\"
  2765. else
  2766. echo shar: Extracting \"'regexp.h'\" \(673 characters\)
  2767. sed "s/^X//" >'regexp.h' <<'END_OF_FILE'
  2768. X/*
  2769. X * Definitions etc. for regexp(3) routines.
  2770. X *
  2771. X * Caveat:  this is V8 regexp(3) [actually, a reimplementation thereof],
  2772. X * not the System V one.
  2773. X */
  2774. X#define void int
  2775. X#define CHARBITS 0377
  2776. X#define NSUBEXP  10
  2777. Xtypedef struct regexp {
  2778. X    char *startp[NSUBEXP];
  2779. X    char *endp[NSUBEXP];
  2780. X    char regstart;        /* Internal use only. */
  2781. X    char reganch;        /* Internal use only. */
  2782. X    char *regmust;        /* Internal use only. */
  2783. X    int regmlen;        /* Internal use only. */
  2784. X    char program[1];    /* Unwarranted chumminess with compiler. */
  2785. X} regexp;
  2786. X
  2787. Xextern regexp *regcomp();
  2788. Xextern int regexec();
  2789. Xextern void regsub();
  2790. Xextern void regerror();
  2791. X
  2792. X#ifdef amiga
  2793. X#undef putchar
  2794. X#define putchar ttputc
  2795. X#endif
  2796. X
  2797. END_OF_FILE
  2798. if test 673 -ne `wc -c <'regexp.h'`; then
  2799.     echo shar: \"'regexp.h'\" unpacked with wrong size!
  2800. fi
  2801. # end of 'regexp.h'
  2802. fi
  2803. if test -f 'stat.h' -a "${1}" != "-c" ; then 
  2804.   echo shar: Will not clobber existing file \"'stat.h'\"
  2805. else
  2806. echo shar: Extracting \"'stat.h'\" \(1496 characters\)
  2807. sed "s/^X//" >'stat.h' <<'END_OF_FILE'
  2808. X/*
  2809. X *  Normally found in <sys/stat.h>
  2810. X */
  2811. X#ifndef STAT_H
  2812. X#define STAT_H
  2813. X
  2814. X#define S_IFMT        0170000        /* Mask for file type */
  2815. X#define S_IEXEC        0000100        /* Owner Execute/search permission */
  2816. X#define S_IWRITE    0000200        /* Owner Write permission */
  2817. X#define S_IREAD        0000400        /* Owner Read permission */
  2818. X#define S_ISVTX        0001000        /* Save swapped text after use */
  2819. X#define S_ISGID        0002000        /* Set group id on execution */
  2820. X#define S_ISUID        0004000        /* Set user id on execution */
  2821. X#define S_IFIFO        0010000        /* A fifo */
  2822. X#define S_IFCHR        0020000        /* A character special file */
  2823. X#define S_IFDIR        0040000        /* A directory file */
  2824. X#define S_IFBLK        0060000        /* A block special file */
  2825. X#define S_IFREG        0100000        /* A a regular file */
  2826. X#define S_IFLNK        0120000        /* A symbolic link (BSD) */
  2827. X
  2828. Xstruct stat {
  2829. X    unsigned short st_mode;    /* File mode as used by mknod */
  2830. X    long   st_ino;    /* Inode number */
  2831. X    unsigned char st_dev;    /* Major device number of device containing file */
  2832. X    unsigned char st_rdev;    /* Minor device number of device containing file */
  2833. X    short st_nlink;    /* Number of links */
  2834. X    unsigned short st_uid;    /* File owner's user ID number */
  2835. X    unsigned short st_gid;    /* File owner's group ID number */
  2836. X    long  st_size;    /* File size in bytes */
  2837. X    unsigned long st_atime;    /* Timestamp of last access to file's contents */
  2838. X    unsigned long st_mtime;    /* Timestamp of last modification of file */
  2839. X    unsigned long st_ctime;    /* Timestamp of file creation */
  2840. X};
  2841. X#define fstat stat
  2842. X#endif
  2843. END_OF_FILE
  2844. if test 1496 -ne `wc -c <'stat.h'`; then
  2845.     echo shar: \"'stat.h'\" unpacked with wrong size!
  2846. fi
  2847. # end of 'stat.h'
  2848. fi
  2849. if test -f 'stat2.c' -a "${1}" != "-c" ; then 
  2850.   echo shar: Will not clobber existing file \"'stat2.c'\"
  2851. else
  2852. echo shar: Extracting \"'stat2.c'\" \(1613 characters\)
  2853. sed "s/^X//" >'stat2.c' <<'END_OF_FILE'
  2854. X#include <libraries/dos.h>      /* For FileInfo struct */
  2855. X#include <exec/memory.h>        /* For MEMF defines ... */
  2856. X#include "sys/types.h"
  2857. X#include "stat.h"
  2858. X#define ERROR    -1
  2859. X
  2860. X/*
  2861. X *  Manx stat() currently isn't very unix compatible, so we roll our
  2862. X *  own...
  2863. X */
  2864. X
  2865. Xtypedef struct stat STAT;
  2866. X
  2867. Xstat (path, buf)
  2868. Xchar *path;
  2869. Xregister STAT *buf;
  2870. X{
  2871. X    long lck;
  2872. X    struct FileInfoBlock *fp;
  2873. X    register long prot;
  2874. X    register long ftime;
  2875. X    extern long Lock ();
  2876. X    extern void *AllocMem ();
  2877. X
  2878. X    if ((lck = Lock (path, ACCESS_READ)) == 0) {
  2879. X        return (-1);
  2880. X    }
  2881. X    fp = (struct FileInfoBlock *)
  2882. X        AllocMem ((long) sizeof (struct FileInfoBlock),
  2883. X        (long) (MEMF_CLEAR | MEMF_CHIP));
  2884. X    Examine (lck, fp);
  2885. X    if (fp -> fib_DirEntryType > 0) {
  2886. X        buf -> st_mode = S_IFDIR;
  2887. X    } else {
  2888. X        buf -> st_mode = S_IFREG;
  2889. X    }
  2890. X    prot = ~(fp -> fib_Protection >> 1);
  2891. X    prot &= 0x7;
  2892. X    buf -> st_mode |= (prot << 6 | prot << 3 | prot);
  2893. X    buf -> st_nlink = 1;
  2894. X    buf -> st_size = fp -> fib_Size;
  2895. X    ftime = fp -> fib_Date.ds_Days * (60L * 60L * 24L);
  2896. X    ftime += fp -> fib_Date.ds_Minute * 60;
  2897. X    ftime += fp -> fib_Date.ds_Tick / TICKS_PER_SECOND;
  2898. X    buf -> st_atime = ftime;
  2899. X    buf -> st_mtime = ftime;
  2900. X    buf -> st_ctime = ftime;
  2901. X    buf -> st_ino = 0;
  2902. X    buf -> st_dev = 0;
  2903. X    buf -> st_rdev = 0;
  2904. X    buf -> st_uid = 0;
  2905. X    buf -> st_gid = 0;
  2906. X    FreeMem (fp, (long) sizeof (struct FileInfoBlock));
  2907. X    UnLock (lck);
  2908. X    return (0);
  2909. X}
  2910. X
  2911. Xlong fsize(name)
  2912. Xchar *name;
  2913. X{
  2914. X    STAT    data;
  2915. X
  2916. X    if(!access(name, 0x00)){
  2917. X        stat( name, &data );
  2918. X        return(data.st_size);
  2919. X    }
  2920. X
  2921. X    return(ERROR);
  2922. X}
  2923. X
  2924. END_OF_FILE
  2925. if test 1613 -ne `wc -c <'stat2.c'`; then
  2926.     echo shar: \"'stat2.c'\" unpacked with wrong size!
  2927. fi
  2928. # end of 'stat2.c'
  2929. fi
  2930. if test -f 'termcap' -a "${1}" != "-c" ; then 
  2931.   echo shar: Will not clobber existing file \"'termcap'\"
  2932. else
  2933. echo shar: Extracting \"'termcap'\" \(653 characters\)
  2934. sed "s/^X//" >'termcap' <<'END_OF_FILE'
  2935. XAP|amiga-p|Amiga ANSI for PAL:\
  2936. X        :co#78:li#30:am:bs:do=\E[B:ce=\E[K:cd=\E[J:\
  2937. X        :cl=\E[H\E[J:ku=\E[A:kd=\E[B:kl=\E[D:kr=\E[C:kb=^H:\
  2938. X        :al=\E[L:dl=\E[M:le=^H:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A:\
  2939. X        :ce=\E[K:ho=\E[H:dc=\E[P:ic=\E[@:\
  2940. X        :so=\E[2m:se=\E[m:us=\E[4m:ue=\E[m:mr=\E[7m:mb=\E[7;2m:me=\FE[m:
  2941. XAN|amiga-n|Amiga ANSI for NTSC:\
  2942. X        :co#78:li#23:am:bs:do=\E[B:ce=\E[K:cd=\E[J:\
  2943. X        :cl=\E[H\E[J:ku=\E[A:kd=\E[B:kl=\E[D:kr=\E[C:kb=^H:\
  2944. X        :al=\E[L:dl=\E[M:le=^H:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A:\
  2945. X        :ce=\E[K:ho=\E[H:dc=\E[P:ic=\E[@:\
  2946. X        :so=\E[2m:se=\E[m:us=\E[4m:ue=\E[m:mr=\E[7m:mb=\E[7;2m:me=\FE[m:
  2947. END_OF_FILE
  2948. if test 653 -ne `wc -c <'termcap'`; then
  2949.     echo shar: \"'termcap'\" unpacked with wrong size!
  2950. fi
  2951. # end of 'termcap'
  2952. fi
  2953. if test -f 'termcap.h' -a "${1}" != "-c" ; then 
  2954.   echo shar: Will not clobber existing file \"'termcap.h'\"
  2955. else
  2956. echo shar: Extracting \"'termcap.h'\" \(508 characters\)
  2957. sed "s/^X//" >'termcap.h' <<'END_OF_FILE'
  2958. X#ifndef _TERMCAP_H
  2959. X#define _TERMCAP_H
  2960. X
  2961. X#ifndef LATTICE
  2962. X#include <ansi.h>
  2963. X
  2964. X_PROTOTYPE( int tgetent, (char *_bp, char *_name)            );
  2965. X_PROTOTYPE( int tgetflag, (char *_id)                    );
  2966. X_PROTOTYPE( int tgetnum, (char *_id)                    );
  2967. X_PROTOTYPE( char *tgetstr, (char *_id, char **_area)            );
  2968. X_PROTOTYPE( char *tgoto, (char *_cm, int _destcol, int _destline)    );
  2969. X_PROTOTYPE( int tputs, (char *_cp, int _affcnt, void (*_outc)(int))    );
  2970. X
  2971. X#endif
  2972. X
  2973. X#ifdef amiga
  2974. X#undef putchar
  2975. X#define putchar ttputc
  2976. X#endif
  2977. X
  2978. X#endif /* _TERMCAP_H */
  2979. END_OF_FILE
  2980. if test 508 -ne `wc -c <'termcap.h'`; then
  2981.     echo shar: \"'termcap.h'\" unpacked with wrong size!
  2982. fi
  2983. # end of 'termcap.h'
  2984. fi
  2985. if test -f 'updact.c' -a "${1}" != "-c" ; then 
  2986.   echo shar: Will not clobber existing file \"'updact.c'\"
  2987. else
  2988. echo shar: Extracting \"'updact.c'\" \(2824 characters\)
  2989. sed "s/^X//" >'updact.c' <<'END_OF_FILE'
  2990. X/*--------------------------------------------------------------------- */
  2991. X/* updact.c                                */
  2992. X/*    Reads in "news:active" and for each news group finds the last   */
  2993. X/*    article. Writes out the updated active file            */
  2994. X/*                                    */
  2995. X/* History:                                */
  2996. X/*    2 Nov 1990    v1.0    Unreleased                 */
  2997. X/*     23 Nov 1990    v2.0    Unreleased                */
  2998. X/*     17 Feb 1991    v2.1                              */
  2999. X/*                                    */
  3000. X/* TODO:                                */
  3001. X/*                                    */
  3002. X/*    Make the logic quicker                         */
  3003. X/*                                    */
  3004. X/* Author:                                */
  3005. X/*    Michael Taylor                             */
  3006. X/*    Canberra, AUSTRALIA                        */
  3007. X/*--------------------------------------------------------------------- */
  3008. X
  3009. X#include <stdio.h>
  3010. X#include <stdlib.h>
  3011. X#include <string.h>
  3012. X#include <sys/types.h>
  3013. X#ifdef DICE
  3014. X#include "stat.h"
  3015. X#else
  3016. X#include <sys/stat.h>
  3017. X#endif
  3018. X#ifdef DICE
  3019. Xtypedef unsigned char uchar;
  3020. X#endif
  3021. X
  3022. Xstatic uchar    line[257];
  3023. X#define MAXGRPS 100
  3024. Xstatic uchar    act_lines[MAXGRPS][257];
  3025. X
  3026. X#define MAXSKIP 1000
  3027. X
  3028. Xmain (argc, argv)
  3029. Xint    argc;
  3030. Xuchar    *argv[];
  3031. X{
  3032. X    FILE    *active;
  3033. X    uchar    *p, fname[80], newsdir[256], artfile[80], *q;
  3034. X    long    article, art2;
  3035. X    int     i, j, limit, fin, found;
  3036. X    struct stat    statbuf;
  3037. X    
  3038. X    active = fopen ("news:active", "rt");
  3039. X    if (active == NULL) {
  3040. X        fprintf (stderr, "active file not found\n");
  3041. X        exit (EXIT_FAILURE);
  3042. X    }
  3043. X
  3044. X    i = 0;
  3045. X    while (fgets (line, 80, active) != NULL) {
  3046. X        if (sscanf (line, "%s %s", newsdir, fname) != 2)
  3047. X            break; /* syntax error on line */
  3048. X
  3049. X        for (q = newsdir; *q != '\0'; ++q)
  3050. X            if (*q == '.')
  3051. X                *q = '/';
  3052. X
  3053. X        found = 1;
  3054. X        for (article = atol(fname), limit = MAXSKIP;; ++article) {
  3055. X            strcpy (artfile, "news:");
  3056. X            strcat (artfile, newsdir);
  3057. X            strcat (artfile, "/");
  3058. X            strcat (artfile, ltoa (article, fname, 10));
  3059. X
  3060. X            fin = stat (artfile, &statbuf);
  3061. X            if (fin == -1) {
  3062. X                for (art2 = article + 1, j = 0;;
  3063. X                     ++art2, ++j) {
  3064. X                    strcpy (artfile, "news:");
  3065. X                    strcat (artfile, newsdir);
  3066. X                    strcat (artfile, "/");
  3067. X                    strcat (artfile,
  3068. X                        ltoa (art2, fname, 10));
  3069. X
  3070. X                    fin = stat (artfile, &statbuf);
  3071. X                    if (fin != -1) {
  3072. X                        article = art2;
  3073. X                        break;
  3074. X                    } else
  3075. X                        if (j >= limit)
  3076. X                            break;
  3077. X                }
  3078. X                if (art2 != article)
  3079. X                    break;
  3080. X
  3081. X                found = 0;
  3082. X            } else {
  3083. X                limit = 25; /* reset limit for missing art's */
  3084. X                found = 0;
  3085. X            }
  3086. X        }
  3087. X        sscanf (line, "%s", newsdir);
  3088. X        strcpy (act_lines[i], newsdir);
  3089. X        strcat (act_lines[i], " ");
  3090. X        strcat (act_lines[i], ltoa (article-1+found, fname, 10));
  3091. X        ++i;
  3092. X        if (i >= MAXGRPS) {
  3093. X            fprintf (stderr,
  3094. X                "Maximum number of groups read: %d \n",
  3095. X                MAXGRPS);
  3096. X            break;
  3097. X        }
  3098. X    }
  3099. X
  3100. X    act_lines[i][0] = ' ';
  3101. X    fclose (active);
  3102. X    active = fopen ("news:active", "wt");
  3103. X    if (active == NULL) {
  3104. X        fprintf (stderr, "could not open active file\n");
  3105. X        exit (EXIT_FAILURE);
  3106. X    }
  3107. X    for (i = 0; act_lines[i][0] != ' '; ++i)
  3108. X        fprintf (active, "%s\n", act_lines[i]);
  3109. X    fclose (active);
  3110. X    exit (EXIT_SUCCESS);
  3111. X}
  3112. END_OF_FILE
  3113. if test 2824 -ne `wc -c <'updact.c'`; then
  3114.     echo shar: \"'updact.c'\" unpacked with wrong size!
  3115. fi
  3116. # end of 'updact.c'
  3117. fi
  3118. echo shar: End of archive 1 \(of 6\).
  3119. cp /dev/null ark1isdone
  3120. MISSING=""
  3121. for I in 1 2 3 4 5 6 ; do
  3122.     if test ! -f ark${I}isdone ; then
  3123.     MISSING="${MISSING} ${I}"
  3124.     fi
  3125. done
  3126. if test "${MISSING}" = "" ; then
  3127.     echo You have unpacked all 6 archives.
  3128.     rm -f ark[1-9]isdone
  3129. else
  3130.     echo You still need to unpack the following archives:
  3131.     echo "        " ${MISSING}
  3132. fi
  3133. ##  End of shell archive.
  3134. exit 0
  3135. -- 
  3136. Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
  3137. Mail comments to the moderator at <amiga-request@uunet.uu.net>.
  3138. Post requests for sources, and general discussion to comp.sys.amiga.misc.
  3139.